Build Failed on Andriod (Daydream). Illegal Characters in Path exepct just after system restart

I bought a Daydream to start Development with it. I made some builds on a friends machine with no issues but on my machine I am getting this error:

ArgumentException: Illegal characters in path.

Here is the whole log:

ArgumentException: Illegal characters in path.
System.IO.Path.Combine (System.String path1, System.String path2) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Path.cs:124)
UnityEditor.Android.AndroidSDKTools.BuildToolsExe (System.String command)
UnityEditor.Android.AndroidSDKTools.get_AAPT ()
UnityEditor.Android.AndroidSDKTools.DumpDiagnostics ()
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSdk.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessAndroidPlayer.PrepareForBuild (BuildOptions options, BuildTarget target)
UnityEditor.Android.AndroidBuildPostprocessor.PrepareForBuild (BuildOptions options, BuildTarget target)
UnityEditor.PostprocessBuildPlayer.PrepareForBuild (BuildOptions options, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:87)
UnityEditor.HostView:OnGUI()

I have spent weeks trying to figure this one out. From putting the slashes at the end of my environmental variables to following this tutorial : http://www.tallior.com/bug-hunting-unity-throws-an-argumentexception-when-building-for-android/

BUT I got new information minutes ago. If I make a build RIGHT AWAY after a system restart… it will get passed this error. Then I got an error about bundle identifiers which I know how to fix. However if I immediatly make another build, I get original error again (illegal characters in path). Can anyone please help me, I am starting to feel I wasted over money building this phone if I cant make builds on it.

I wrote that blog post you mentioned. But i don’t think this is the same issue.

What i would do is setup a breakpoint to see what path the build process is trying to create.

Ftom the stack trace it looks like the path to your Android SDK. Where is it placed? Are there any abnormal characters in this path?

1 Like

I believe this is what is being sent as the path

C:\AndioSDK\build-tools\25.0.1
[0x7FFAF00C70E3] ANOMALY: use of REX.w is meaningless (default operand size is 64)

It may be Trend Micro’s anti-virus protection.

https://esupport.trendmicro.com/en-us/home/pages/technical-support/1115404.aspx

I am trying this now (posting it first in case it helps someone else)

It was 100% Trend Micro’s anti-virus protection

I didn’t uninstall, but I exited it from the tray and now I can make builds

@liortal : Thanks for that post, it did help figure out the problem.

1 Like