I am currently learning AR Development by using Unity and Visual Studio Code on MacOS. I understand that part of the process is downloading the Mono.Framework in order to be able to use the autocompletion feature. That's what I did, but VS Code is throwing me an error: Unable to find Mono. Ensure that Mono's '/bin' folder is added to your environment's PATH variable.
Right now, I'm trying to edit my PATH variable which is
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands. I want to remove "/Commands" folder and replace it with the "/bin" folder.
So far, I've tried to re-start my computer, and when I open Unity and then a C# Script via Unity, it would work fine. I'd get the autocompletion to work with no problems. But when I close the Script and try to re-open it, I'd start getting the aforementioned error.
I tried to uninstall and reinstall Mono twice.
Also I t have tried is to add export PATH=/Library/Frameworks/Mono.framework/Versions/Current/bin:$PATH on my .bash_profile
The Expected Result result is this one:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/bin
but the Result I get is this:
/Library/Frameworks/Mono.framework/Versions/Current/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
How can I change the "/Commands" folder and replace it with the "/bin" folder?
P.D. That is what I think is the best course of action in order to solve the error, but I'm totally open to be corrected in case I'm wrong.
More info:
MacOS - 12.1
Unity - 2021.1.9f1
VS Code - 1.56.2 (Universal)
Mono - 6.12.0.122
I'm beginning my first Xamarin project. I started with setting up an android project and I have gotten it working with the emulator.
But after following the instructions of this video
(https://www.youtube.com/watch?v=mbIvG8ripcw&t=590s&ab_channel=GeraldVersluis)
I get the following error when I try to build:
Expected "!$([System.String]::new('%(ReferenceCopyLocalPaths.Identity)').EndsWith('System.Runtime.dll'))" to evaluate to a boolean instead of "!$([System.String]::new('E:\(PATH TO APP FOLDER)\Notes App\NotesApp\NotesApp\bin\Debug\netstandard2.0\NotesApp.dll').EndsWith('System.Runtime.dll'))", in condition "'$(_CoreFrameworkPackageId)' != ''
AND !$([System.String]::new('%(ReferenceCopyLocalPaths.Identity)').EndsWith('System.Runtime.dll'))
AND '%(ReferenceCopyLocalPaths.NuGetPackageId)' == '$(_CoreFrameworkPackageId)'". NotesApp.UWP
^^ The error code I get for this is MSB4100
I also keep having the Nuget packages Xamarin.Forms and the Microsoft.NETCore.UniversalWindowsPlatform go missing from the references of my project even though they are installed within it. After restarting VS multiple times and toggling on/off settings that alters the project/solution heavily they pop back into existance.
These packages when they go missing give me 10s and I even saw once, 200 errors and they all disappear after turning on and then off again, for example "Compile with .NET Native tool chain" in the build settings.
But the big error above still remains.
========================================
All Nuget packages are up to date and VS is up to date (and I used the repair tool).
I've removed the UWP project and created a new one, and I get the same result.
If anyone can help me solve this and let me know if I've made a silly mistake it would be appreciated. I would like to master this.
If you need any more info let me know, thanks.
Update 1
I've reinstalled my nuget packages and restarted VS and this is my screen. Note I have the package on screen installed but not showing up in my references. Plus some warnings that go away when they feel like it.
Update 2
I created a brand new xamarin android and uwp project template, did not touch a thing, and I tried to build and deploy the uwp project and I get this error
I created a project that was not buring by many layers of folders, in my C drive and not my external exFAT E drive and it now works.
Thanks for your help guys.
I have been using Unity for a year now and have decided to make a simple chat app. I decided to use Google's Firebase to store my user and chat data. I plan to have the app on android(iOS in the future). My problem is with Unity not being able to generate a Firebase Android File. I searched the error up and it took me to this website. I did the recommend solution and created the realtime database and re installed the json and plist files. It did not work. I still get the following error.
Generation of the Firebase Android resource file google-services.xml from /Users/Family/Desktop/கலைமாறன்/Unity/STEMastery/Assets/../Assets/Firebase Data/google-services.json failed.
If you have not included a valid Firebase Android resources in your app it will fail to initialize.
"python" "/Users/Family/Desktop/கலைமாறன்/Unity/STEMastery/Library/PackageCache/com.google.firebase.app#7.2.0/Firebase/Editor/generate_xml_from_google_services_json.py" -i "/Users/Family/Desktop/கலைமாறன்/Unity/STEMastery/Assets/../Assets/Firebase Data/google-services.json" -o "/Users/Family/Desktop/கலைமாறன்/Unity/STEMastery/Assets/../Assets/Plugins/Android/FirebaseApp.androidlib/res/values/google-services.xml" -p "com.maranstudios.stemastery.maran" ...
I also checked the external tools. Under android it says JDK installed with Unity, Android SDK tools installed with Unity, Android NDK Installed with Unity and Gradle Installed with Unity. I also donwloaded the android studio so I can build to android.
I have also tried to restarted unity, visual studio and even my computer, but that did not help.
Unity runs the program perfectly well on my iMac and can access my RealTime Database in the unity editor. But when I run it on my phone 2 errors pop up.
DllNotFound Exception: Firebase CppApp ...
It can not find the default reference.
2's Explanation:
I have this line of code.
DatabaseReference reference = FirebaseDatabase.DefaultInstance.RootReference;
I then check in another script if t hat is null. It becomes null on my phone, but works fine on my mac.
I am using macOS Mojave (Version 10.14.4).
My unity version is Unity 2020.3.4f1.
My phone uses android 10.
I have tried everything that I can think of to deal with this error. I believe that by fixing this error, my app will work properly on my phone. I have tried to give all the information needed to help you understand my issues. If I am still missing any, please ask and I will respond as soon as possible.
EDIT :
I tried a couple new things. I upgraded to unity 2020.7, but that did not work. I also tried to create a new project from scratch using Unity 2019, but I am still getting that same error. Could it be that Firebase just doesn't work on my mac or is that this a bug in Unity that has somehow existed over several versions? I really could use some help figuring out to integrate Firebase. Any help is appreciated.
This is a known issue with developers who have non-ascii usernames. See this issue and this issue. It might be worth opening a new issue and highlighting that it's blocking active development right now (note for future readers, the first issue is closed but the second is open as I write. If 690 is also closed with a milestone associated, this means that the issue has been fixed).
For potential workarounds, the best known workaround would be to use a username without any extended non-ascii characters. I know that this can be problematic or disruptive.
You may try disabling persistence in the Editor before making any database calls. This might prevent Firebase from trying to read your local data folder, avoiding the issue:
var database = FirebaseDatabase.DefaultInstance;
if (Application.isEditor) {
database.SetPersistenceEnabled(false);
}
var reference = database.RootReference;
You only have to do this once for your game (so maybe immediately after CheckAndFixDependenciesAsync), but putting it right before database access should makes my example code safer.
I have to build android app using Unity 2018.4.9f1 with App Bundle (Google play) and I get this error. When building normal apk everything is working fine.
1 exception was raised by workers:
com.android.tools.build.bundletool.exceptions.BundleFileTypesException$FileUsesReservedNameException: File 'root/res/drawable-hdpi/ic_launcher.png' uses reserved file or directory name 'res'.
Tried diffrent unity versions. Tried deleting this file (but looks like it's hidden somewhere or generating during gradle compile)
I'm using Unity 2019.4.0f1 and got stuck in the same error. Here's what I've found on internet and solved.
(you probably got a solution, but it's good for those who will see this post)
Open your project settings > Player > Other Settings, loko for configuration, make sure you ticked this options below:
Player setup
Scripting Backend IL2CPP
Enable ARMv7, ARM64, Split APKs by target architecture
Then in your Build Settings
Build settings setup
Just default values (unity 2019.4 version).
Hope that helps someone :)
[edit 1]
I know this doesn't fix the android bundle app build, I think that's an unity bug, not sure, however this should work fine on google play console (worked for me)
Although it's only remotely related to programming, here it goes:
Since last week, I've been playing with Unity (5.6.0f3 Community x64) on Win 10 (x64) - using Visual Studio (2017 Community) as attached editor, as Unity "requires" -, and started with the [Unity]: Tutorials (first of them). For a few days everything went just fine, but then, building for PC Standalone target, stopped working. Googleing and checking the forums, didn't help finding information about this exact behavior:
As seen on the Build Settings dialog (moved to the right), there are no (Target Platform or Architecture) combo-boxes allowing to specify build parameters. Errors are on the left side.
Notes (about the current behavior):
First guess was that the tutorial project became somehow messed up, so I created a new one from scratch (a dummy / simple one containing one Sphere having attached a Rigidbody and a C# script that applies forces based on user input), but it behaves the same (this is the project build output in the above image)
WebGL build runs just fine (loads in browser); this is the workaround currently used, but it takes ages to complete
Playing (obviously) also works (needless to say that things are OK in VStudio, no complains from csc), !!!but!!! after trying (and failing) to build, Playing no longer works (reloading the project is the only way to fix it)
To rule out any possible doubts, here's a DownloadAssistant screenshot:
Everything is checked, there are 2 items (not very relevant to this case) that are not showing (because the window is not sizeable), but they are checked (and installed).
Background info:
When first installing Unity, there was no VStudio 2017 version present on the computer, so it (Community Edition) was installed as part of Unity install process (I remember (at least) one VStudio related combo-box in the Assistant)
Then, a VStudio patch was available; when preparing to install it, I realized that VStudio was installed on the default path (on %SYSTEMDRIVE%), which doesn't work for me, since it's a large product, so:
Uninstalled it
Reinstalled it (directly from [VisualStudio]: Visual Studio Downloads) on a different drive (and yes, I am aware that changing the install path, still installs a pretty big part like Windows SDK on %SYSTEMDRIVE%)
Since I thought that the above 2 steps would break the link between Unity and the new VStudio, I also reinstalled Unity. This time, there were no VStudio related check-boxes in the Assistant (seems normal to check if any piece of software that it needs to install, isn't already installed 1). Later on, I also found a persistent (meaning that it's not wiped out at Unity uninstall time) RegValue (HKEY_CURRENT_USER\SOFTWARE\Unity Technologies\Installer\Select_VisualStudio) with a value of 0 (as opposed to a bunch of other values under the same key with values of 1)
After that, I reinstalled Unity several times, including reboots (not required) between uninstall / install, but no result (I also took a long shot of enabling the RegVaue above before starting Assistant)
A little debugging revealed that when trying to build (PC Standalone), Unity does something like this (don't mind the paths, it's how they're on my machine), that can be reproduced from cmdline:
build_win.bat:
"E:\Install\x64\Unity\5.6.0f3\Editor\Data\MonoBleedingEdge\bin\mono.exe" "E:\Install\x64\Unity\5.6.0f3\Editor\Data\MonoBleedingEdge\lib\mono\4.5\mcs.exe" "#args-win.txt"
args_win.txt:
-debug
-target:library
-nowarn:0169
-langversion:4
-out:Temp/Assembly-CSharp.dll
-unsafe
-optimize
-r:E:/Install/x64/Unity/5.6.0f3/Editor/Data/UnityExtensions/Unity/GUISystem/Standalone/UnityEngine.UI.dll
-r:E:/Install/x64/Unity/5.6.0f3/Editor/Data/UnityExtensions/Unity/Networking/Standalone/UnityEngine.Networking.dll
-r:E:/Install/x64/Unity/5.6.0f3/Editor/Data/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll
-define:UNITY_5_3_OR_NEWER
-define:UNITY_5_4_OR_NEWER
-define:UNITY_5_5_OR_NEWER
-define:UNITY_5_6_OR_NEWER
-define:UNITY_5_6_0
-define:UNITY_5_6
-define:UNITY_5
-define:UNITY_ANALYTICS
-define:ENABLE_AUDIO
-define:ENABLE_CACHING
-define:ENABLE_CLOTH
-define:ENABLE_DUCK_TYPING
-define:ENABLE_GENERICS
-define:ENABLE_PVR_GI
-define:ENABLE_MICROPHONE
-define:ENABLE_MULTIPLE_DISPLAYS
-define:ENABLE_PHYSICS
-define:ENABLE_RUNTIME_NAVMESH_BUILDING
-define:ENABLE_SPRITERENDERER_FLIPPING
-define:ENABLE_SPRITES
-define:ENABLE_TERRAIN
-define:ENABLE_RAKNET
-define:ENABLE_UNET
-define:ENABLE_LZMA
-define:ENABLE_UNITYEVENTS
-define:ENABLE_WEBCAM
-define:ENABLE_WWW
-define:ENABLE_CLOUD_SERVICES_COLLAB
-define:ENABLE_CLOUD_SERVICES_ADS
-define:ENABLE_CLOUD_HUB
-define:ENABLE_CLOUD_PROJECT_ID
-define:ENABLE_CLOUD_SERVICES_UNET
-define:ENABLE_CLOUD_SERVICES_BUILD
-define:ENABLE_CLOUD_LICENSE
-define:ENABLE_EDITOR_METRICS
-define:ENABLE_EDITOR_METRICS_CACHING
-define:ENABLE_NATIVE_ARRAY
-define:INCLUDE_DYNAMIC_GI
-define:INCLUDE_GI
-define:PLATFORM_SUPPORTS_MONO
-define:RENDER_SOFTWARE_CURSOR
-define:INCLUDE_PUBNUB
-define:ENABLE_PLAYMODE_TESTS_RUNNER
-define:ENABLE_SCRIPTING_NEW_CSHARP_COMPILER
-define:ENABLE_VIDEO
-define:UNITY_STANDALONE_WIN
-define:UNITY_STANDALONE
-define:ENABLE_SUBSTANCE
-define:ENABLE_RUNTIME_GI
-define:ENABLE_MOVIES
-define:ENABLE_NETWORK
-define:ENABLE_CRUNCH_TEXTURE_COMPRESSION
-define:ENABLE_UNITYWEBREQUEST
-define:ENABLE_CLOUD_SERVICES
-define:ENABLE_CLOUD_SERVICES_ANALYTICS
-define:ENABLE_CLOUD_SERVICES_PURCHASING
-define:ENABLE_CLOUD_SERVICES_CRASH_REPORTING
-define:ENABLE_EVENT_QUEUE
-define:ENABLE_CLUSTERINPUT
-define:ENABLE_VR
-define:ENABLE_WEBSOCKET_HOST
-define:ENABLE_MONO
-define:NET_2_0_SUBSET
Assets/_Scripts/x.cs
-r:E:\Install\x64\Unity\5.6.0f3\Editor\Data\Mono\lib\mono\unity\System.Runtime.Serialization.dll
-r:E:\Install\x64\Unity\5.6.0f3\Editor\Data\Mono\lib\mono\unity\System.Xml.Linq.dll
-r:E:\Install\x64\Unity\5.6.0f3\Editor\Data\Mono\lib\mono\unity\UnityScript.dll
-r:E:\Install\x64\Unity\5.6.0f3\Editor\Data\Mono\lib\mono\unity\UnityScript.Lang.dll
-r:E:\Install\x64\Unity\5.6.0f3\Editor\Data\Mono\lib\mono\unity\Boo.Lang.dll
-sdk:unity
args_win.txt is a copy of one of the ${PROJECT_ROOT}\Temp\UnityTempFile-*s (I'm going to refer to such a file as utfile), more precisely of the one that gets created when starting the build. The funky thing is that it's created from another (one of the 10+ identical created at project load time) utfile by (didn't do a through check, maybe there are additional lines as well) striping (and shuffling (amestecating)) some lines.
The obvious one (don't even have to check the source utfile) is: -r:E:/Install/x64/Unity/5.6.0f3/Editor/Data/Managed/UnityEngine.dll, which inserted in the above file, works perfectly. But I don't know how to instruct Unity not to strip it.
Other facts (more or less relevant):
There are several other VStudio versions installed (2010, 2013, 2015), and more VCRedists, but I seriously doubt that any of this would make a difference, since VStudio is only used for editing (e.g. launched by Unity when dblclicking a script)
My computer also "suffers" from [BT]: Has your Windows 10 Start menu stopped working? How to fix it (I restart it ~once a week; after ~3-4 days the problem reappears), but this is happening for weeks before installing Unity
Possible solutions:
Uninstall Unity and VStudio, and restore the original setup (if it still works) - not desirable
Get an answer (here or on Unity forums, where I'm going to post the same question right away), and hopefully get to the bottom of it
Start the painful process of debugging/monitoring ([MS.Docs]: Process Monitor (ProcMon) is an excellent tool) also, might involve disassembling UnityDownloadAssistant-5.6.0f3.exe, but there are no guarantees that it would yield a (favorable) result. Anyway, I think there is a (hidden for now) link between:
VStudio check-box not being present in Assistant, when VStudio already installed
Lack of the build parameters combo-boxes for PC Standalone
Stripping the UnityEngine.dll dependency when building
A possible work plan / algorithm for fixing this would be (just theory):
Debugging the Assistant and identifying the resource (registry value, file, ...) queried for VStudio installation status
Tweak that resource to make Assistant "think" that VStudio is not installed; that would trigger the VStudio installer (and also make Assistant "mark" that this installation as suitable for PC Standalone builds), which would detect a previous installation (of course before this, the resource (if the same) needs to be untweaked) and would fail (another long shot here would be that Assistant doesn't check the return codes)
Let Assistant finish and hopefully everything will be fine
Any ideas are welcome.
Side note 1 (not related to question): While uninstalling/installing Unity, I noticed smth; if it's Community Edition specific, I can (sort of) understand it, but if not, then it's a quite lame bug / behavior:
Have Unity installed (fully as above)
Run the Assistant and don't change anything from previous installation (the parent RegKey of the RegValue that I mentioned above, makes sure of that by default). It will:
Download (and overwrite ???) any sub pkg (e.g. UnitySetup-Linux-Support-for-Editor-5.6.0f3.exe, FacebookGamesArcade.msi, ...); for me it was ~3GB+ (even if the files were already there)
Run every specified("checked") pkg / file
Remove (UnitySetup64.exe) any existing installation before installing (???)
The problem seems introduced when adding Facebook Gameroom build support and is not yet fixed as of 2017.3.1f.
Workaround:
Go to Unity folder (C:\Program Files\Unity on Windows x64)
Move Unity/Editor/Data/PlaybackEngines/Facebook to the Unity folder, so now you have Editor and Facebook next to each other
By #jura_z at
https://forum.unity.com/threads/installing-facebook-gameroom-build-support-gives-loads-of-errors-when-building-to-windows-standalone.489495/
Long story
Apparently, there wasn't an easy fix (or at least I couldn't find any), so I started the "extremely challenging" process of uninstalling / reinstalling Unity and VStudio (with restarts after uninstall - to make sure that there are no "hidden" operations left hanging).
I started by looking at what the Assistant does under the hood, by specifying a custom download path, as in the image below:
Note: The installation paths are a little bit different from the ones in the question because I changed them (since I had to reinstall the products why not make some use of it?), but those changes are not relevant.
In the specified folder there were a bunch(~3GB+) of downloaded files (executables), and a batch script that is the command line equivalent of the Assistant.
install.bat:
REM Run this script to automatically install or reinstall all packages,
REM as it's performed by the Unity Download Assistant.
REM Needs to be run with superuser permissions.
"UnitySetup64.exe" -UI=reduced /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnityDocumentationSetup.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnityStandardAssetsSetup.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnityExampleProjectSetup.exe" /S
"vs_Community.exe" --productId "Microsoft.VisualStudio.Product.Community" --add "Microsoft.VisualStudio.Workload.ManagedGame" --campaign "Unity3d_Unity" --passive
msiexec.exe /i "FacebookGamesArcade.msi" /qr LAUNCHEXE=FALSE
"UnitySetup-Android-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-iOS-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-AppleTV-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-Linux-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-Mac-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-Metro-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-UWP-IL2CPP-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-Samsung-TV-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-Tizen-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-WebGL-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-Facebook-Games-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
The one that caught my eye was the VStudio related one:
"vs_Community.exe" --productId "Microsoft.VisualStudio.Product.Community" --add "Microsoft.VisualStudio.Workload.ManagedGame" --campaign "Unity3d_Unity" --passive
As (some of) the launcher arguments didn't say much to me, I looked them up: [MS.Docs]: Use command-line parameters to install Visual Studio 2017. So, I launched it by command line (without --passive tho get a chance of looking what features are selected), and I thought I've got it: the Game development with Unity was selected as in the image below (before, when I was installing VStudio "normally", I didn't check that box):
But the behavior was the same !!!
Notes:
If you choose to install this option (and also install Unity yourself), make sure to uncheck Unity editor, to avoid installing it twice
As I later found out (by reinstalling, of course), checking / unchecking Game development with Unity has absolutely no impact
Also, the fact that VStudio wasn't installed on its default path (at some point I became paranoid and thought that there might be some VStudio hardcoded paths in Unity files) was not the cause
The next step that I did, was to recreate the initial scenario (where it used to work):
Install VStudio with "my" initial options (e.g. Game development with Unity unchecked)
Install Unity with default options - deleting its RegKey (that I mentioned in the question) prior to installation
and it worked !!!
Then I knew that one of the Unity components is screwing around with my settings, so on top of the basic installation (the contents of the install.bat til vs_Community.exe) I started installing all the other options, one by one, and after each component install check whether I am able to do a PC Standalone build, and ...
Short story
It turns out that Facebook Gameroom Build Support (as showing in the Assistant) was the root of all my problems. So, another clean install of (both VStudio and) Unity (without the Facebook build support) works like a charm.
Now, the investigation is only half way done, I still need to find out why does this happen, but I'm going to stop here. If in the future, I'll need to build for Facebook, then I'll have to figure it out and make it work, but for now I won't. Note that for my (noobish) purpose, Standalone (PC since currently I'm on Win) builds are enough (and maybe WebGL as well to test from browser), but I installed all the others in case I want to play around with them.