Hello,
I’ve run into an issue building to Android from Windows 7 x64. I have tried reinstalling Unity and the Android SDK multiple times and the problem still persists.
The behavior is that when building, Unity declares my path to the Android SDK invalid, clearing its preferences setting for the Android SDK path and asking me for a new one.
As soon as I do this, the build process aborts with these exceptions:
Error building Player: ArgumentException: Illegal characters in path.
UnityEditor.HostView:OnGUI()
Exception: Error building Player: ArgumentException: Illegal characters in path.
UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:341)
UnityEditor.BuildPlayerWindow.GUIBuildButtons (Boolean enableBuildButton, Boolean enableBuildAndRunButton, Boolean canInstallInBuildFolder) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:942)
UnityEditor.BuildPlayerWindow.ShowBuildTargetSettings () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:923)
UnityEditor.BuildPlayerWindow.OnGUI () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:697)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
Here’s the excerpt from the log file:
Unloading 157 unused Assets to reduce memory usage. Loaded Objects now: 1268.
System memory in use: 188.0 MB.
Unloading 13 Unused Serialized files (Serialized files now loaded: 2 / Dirty serialized files: 2)
Error building Player: ArgumentException: Illegal characters in path.
UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, BuildTarget, BuildOptions)
UnityEditor.BuildPlayerWindow:BuildPlayerWithDefaultSettings(Boolean, BuildOptions) (at C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\BuildPlayerWindow.cs:339)
UnityEditor.BuildPlayerWindow:GUIBuildButtons(Boolean, Boolean, Boolean) (at C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\BuildPlayerWindow.cs:942)
UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings() (at C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\BuildPlayerWindow.cs:923)
UnityEditor.BuildPlayerWindow:OnGUI() (at C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\BuildPlayerWindow.cs:697)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEditor.HostView:Invoke(String, Object) (at C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\DockArea.cs:213)
UnityEditor.HostView:Invoke(String) (at C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\DockArea.cs:206)
UnityEditor.HostView:OnGUI() (at C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\DockArea.cs:107)
[C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Src/Commands/BuildPlayerUtility.cpp line 1534]
(Filename: C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs Line: 339)
- starting compile Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll, for buildtarget 13
*** Cancelled 'Build.Player.AndroidPlayer' in 8 seconds
Exception: Error building Player: ArgumentException: Illegal characters in path.
at UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions) [0x001b1] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\BuildPlayerWindow.cs:341
at UnityEditor.BuildPlayerWindow.GUIBuildButtons (Boolean enableBuildButton, Boolean enableBuildAndRunButton, Boolean canInstallInBuildFolder) [0x0006d] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\BuildPlayerWindow.cs:942
at UnityEditor.BuildPlayerWindow.ShowBuildTargetSettings () [0x0054f] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\BuildPlayerWindow.cs:923
at UnityEditor.BuildPlayerWindow.OnGUI () [0x000f9] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\BuildPlayerWindow.cs:697
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
at UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) [0x0000f] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\DockArea.cs:213
at UnityEditor.HostView.Invoke (System.String methodName) [0x00000] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\DockArea.cs:206
at UnityEditor.HostView.OnGUI () [0x00058] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\DockArea.cs:107
(Filename: C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs Line: 341)
- Finished compile Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll
- starting compile Library/ScriptAssemblies/Assembly-UnityScript.dll, for buildtarget 13
- Finished compile Library/ScriptAssemblies/Assembly-UnityScript.dll
Non platform assembly: data-0EFBD1D8 (this message is harmless)
Non platform assembly: data-0F2DCF38 (this message is harmless)
Platform assembly: C:\dev\Unity\Data\Mono\lib\mono\2.0\I18N.dll (this message is harmless)
Platform assembly: C:\dev\Unity\Data\Mono\lib\mono\2.0\I18N.West.dll (this message is harmless)
Mono: successfully reloaded assembly
NullReferenceException: Object reference not set to an instance of an object
at UnityEditor.ListViewShared.HasMouseDown (UnityEditor.InternalListViewState ilvState, Rect r, Int32 button) [0x00000] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\ListViewShared.cs:180
at UnityEditor.ListViewShared.HasMouseDown (UnityEditor.InternalListViewState ilvState, Rect r) [0x00000] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\ListViewShared.cs:175
at UnityEditor.ListViewShared+ListViewElementsEnumerator.MoveNext () [0x0000c] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\ListViewShared.cs:368
at UnityEditor.ConsoleWindow.OnGUI () [0x00386] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\ConsoleWindow.cs:422
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
(Filename: C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/ListViewShared.cs Line: 180)
NullReferenceException: Object reference not set to an instance of an object
at UnityEditor.ListViewShared.HasMouseDown (UnityEditor.InternalListViewState ilvState, Rect r, Int32 button) [0x00000] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\ListViewShared.cs:180
at UnityEditor.ListViewShared.HasMouseDown (UnityEditor.InternalListViewState ilvState, Rect r) [0x00000] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\ListViewShared.cs:175
at UnityEditor.ListViewShared+ListViewElementsEnumerator.MoveNext () [0x0000c] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\ListViewShared.cs:368
at UnityEditor.ConsoleWindow.OnGUI () [0x00386] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\ConsoleWindow.cs:422
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
(Filename: C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/ListViewShared.cs Line: 180)
NullReferenceException: Object reference not set to an instance of an object
at UnityEditor.ListViewShared.HasMouseDown (UnityEditor.InternalListViewState ilvState, Rect r, Int32 button) [0x00000] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\ListViewShared.cs:180
at UnityEditor.ListViewShared.HasMouseDown (UnityEditor.InternalListViewState ilvState, Rect r) [0x00000] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\ListViewShared.cs:175
at UnityEditor.ListViewShared+ListViewElementsEnumerator.MoveNext () [0x0000c] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\GUI\ListViewShared.cs:368
at UnityEditor.ConsoleWindow.OnGUI () [0x00386] in C:\BuildAgent\work\6bc5f79e0a4296d6\Editor\Mono\ConsoleWindow.cs:422
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
(Filename: C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/ListViewShared.cs Line: 180)
This issue only occurs when attempting to build to Android; I can build to standalone and web players without any problems, but it occurs on EVERY project, even one consisting of just the default scene. I have reinstalled Unity, scrubbing the registry of the entries I could find, as well as the Android SDK. I have also moved all of the paths around to avoid anything that could POSSIBLY be legitimately invalid – for example, Unity and the Android SDK both live in C:\Dev\ instead of good old Program Files (x86), etc.
As a side note, random (disturbing) exceptions appear intermittently throughout Unity. For example, double-clicking on an error in the console gives me this:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ListViewShared.HasMouseDown (UnityEditor.InternalListViewState ilvState, Rect r, Int32 button) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/ListViewShared.cs:180)
UnityEditor.ListViewShared.HasMouseDown (UnityEditor.InternalListViewState ilvState, Rect r) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/ListViewShared.cs:175)
UnityEditor.ListViewShared+ListViewElementsEnumerator.MoveNext () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/ListViewShared.cs:368)
UnityEditor.ConsoleWindow.OnGUI () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/ConsoleWindow.cs:422)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
So, it seems like something is seriously and fundamentally screwed with Unity on this computer.
Please help – I’ve uninstalled and reinstalled everything that seems directly relevant and I’m not sure what else to try. This is my main Unity dev system and so my next step is pretty much to reinstall Windows unless someone here has a suggestion, and I have no idea where the disc is.
Thanks,
-Umo