Build error: Cached player destination differs from selected player destination - unity3d

I had a problem with my unity project build, I add SDK last version in Unity preference but the bellow error was generated.
Error building scripts: Cached player destination differs from selected player destination. Please disable scripts only build and build again before attempting another scripts only build.
Build completed with a result of 'Failed UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
UnityEditor.BuildPlayerWindow+BuildMethodException: Error building scripts: Cached player destination differs from selected player destination. Please disable scripts only build and build again before attempting another scripts only build
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:182
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:89 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Related

What causes Hololens v1 build error "Handedness is an ambiguous reference"? [duplicate]

I try to build my Hololens 2 application but i get errors which i can not solve.
When I try to test the application with the Unity play button, it works as expected. I have also tried the MRTK sample scene, which also works only through the play button, but does not when I try to build it.
Build Errors:
Library\PackageCache\com.microsoft.mixedreality.toolkit.foundation#251fc689f36f\Providers\WindowsMixedReality\XRSDK\WindowsMixedRealityDeviceManager.cs(404,128): error CS0104: 'Handedness' is an ambiguous reference between 'Microsoft.MixedReality.Input.Handedness' and 'Microsoft.MixedReality.Toolkit.Utilities.Handedness'
Error building Player because scripts had compiler errors
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <1135c66e5f4c41a7831fa5798849d8b6>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <1135c66e5f4c41a7831fa5798849d8b6>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
I tried to update the MRTK with the MixedRealityFeatureTool and did the Mixed Reality Toolkit-Set Up as described in the tutorial. But i still get the errors, which means i can not test it on the Hololens 2.
Also happening for me and only happened when upgraded to MRTK 2.8.
As we are developing for HoloLens, there is no need for the MixedReality.Input package, which is causing the conflict. Simply remove that from the Package Manager.
I had this problem but I was able to fix the error by going to the script in the specified path (Library\PackageCache\com.microsoft.mixedreality.toolkit.foundation#251fc689f36f\Providers\WindowsMixedReality\XRSDK\WindowsMixedRealityDeviceManager.cs) in the error, going into the error line (404) and changing Handedness to 'Microsoft.MixedReality.Toolkit.Utilities.Handedness'

Build completed with a result of 'Failed' UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

I am unable to build my app on unity, it is always shoeing gradle build error
Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
UnityEditor.BuildPlayerWindow+BuildMethodException: 26 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer
(UnityEditor.BuildPlayerOptions options) [0x00242] in
C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:194
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean
askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions)
[0x0007f] in
C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:97
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
What helped me was that I added a preprocessor directive in front of every using UnityEditor;
For example:
#if UNITY_EDITOR
using UnityEditor;
#endif
Also, I need to change the C# API compatibility Level, because I was using some functions from a newer API. You can change it under Edit -> Project Settings -> Player -> Other Settings -> Api Compatibility Level (from .NET Standard 2.0 to .NET 4.x)

don't build unity programm

dont build unity programm. Click "Build and Run" and get error:
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:194
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:97
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
Unity is instaled on disk D: And by path C:\buildslave\unity\build.... I dont have anything
I have seen a lot of different answers, but in my case, when building to Standalone, it turned out I left the game running from the previous build and it was preventing the new build from creating an executable.
Same 2 errors [0x00242] and [0x0007f].
I just had to close the game...

Unity3d : can't add script component in the gameobject because of C# Native Integration

Everytime I try to add new script to any prefab Im getting this message
"Can't add script component because the script class cannot be found. Make sure there are no compile errors"
And yes the file name matches.
I'm using the latest version currently 2018.3.5f1
I was using recently "Unity C# 5.0 and 6.0 Integration" from here
because I was having this kind of error in the console
"error CS1644: cannot be used, because it is not part of the C# 4.0 language specification."
After that not knowing how to uninstall this I removed the folder and reimported the asset
Now I'm having this error which causing me the script component add, supposedly
UnityEditor.Scripting.Compilers.ScriptCompilerBase.BeginCompiling () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/ScriptCompilerBase.cs:60)
UnityEditor.Scripting.ScriptCompilation.CompilationTask.QueuePendingAssemblies () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CompilationTask.cs:228)
UnityEditor.Scripting.ScriptCompilation.CompilationTask.Poll () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CompilationTask.cs:135)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.CompileScriptAssemblies (UnityEditor.Scripting.ScriptCompilation.ScriptAssembly[] scriptAssemblies, UnityEditor.Scripting.ScriptCompilation.ScriptAssemblySettings scriptAssemblySettings, System.String tempBuildDirectory, EditorScriptCompilationOptions options, CompilationTaskOptions compilationTaskOptions, CompileScriptAssembliesOptions compileScriptAssembliesOptions) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:1133)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.CompileCustomScriptAssemblies (UnityEditor.Scripting.ScriptCompilation.ScriptAssemblySettings scriptAssemblySettings, System.String tempBuildDirectory, EditorScriptCompilationOptions options, BuildTargetGroup platformGroup, BuildTarget platform) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:1045)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.CompileCustomScriptAssemblies (EditorScriptCompilationOptions options, BuildTargetGroup platformGroup, BuildTarget platform) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:1039)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface+c__AnonStorey4.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:277)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface.EmitExceptionAsError[Boolean] (System.Func`1 func, Boolean returnValue) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:97)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:CompileCustomScriptAssemblies(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget)
Any ideas ?
I had to export my asset package
Reinstall unity
Create new project folder
And Import the asset, the error are gone turn out my folder was the issue

Facebook.Unity.Gameroom.dll was not registered

Unity3D version 2017.1.1f1
Whenever I launch Unity, I get the following error:
Assertion failed: Extension
Library/FacebookSDK/Facebook.Unity.Gameroom.dll was not registered,
that means it relies on default UnityExtensions settings, please
register extension and apply necessary settings for it in the
callback. I tried deleting the Library folder but the problem is still
there and the file Facebook.Unity.Gameroom.dll also exists.
Also when I try to build for WebGL, 3 more errors are shown and build fails. The first one is as follows:
ArgumentException: The Assembly Facebook.Unity is referenced by
Facebook.Unity.Gameroom
('Library/FacebookSDK/Facebook.Unity.Gameroom.dll'). But the dll is
not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse
(System.String assemblyPath, System.Collections.Generic.List1
alreadyFoundAssemblies, System.String[] allAssemblyPaths,
System.String[] foldersToSearch,
System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at
C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:142)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[]
paths, System.String[] foldersToSearch, BuildTarget target) (at
C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:179)
UnityEditor.HostView:OnGUI()
How can I solve this?