Error Building Player - Win32 Exception

2019-09-11 07:36发布

问题:

Someone please help, I've spent 2 days on this. I'm building a game in Unity for Android. I have installed Java, set the environmental path to the bin in programme files, installed Android SDK as usual BUT, I cant get rid of this error:

Error building Player: Win32Exception: ApplicationName='C:\Users\Kelly's User\AppData\Local\Android\android-sdk\build-tools\23.0.1\aapt.exe', CommandLine='package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/Kelly's User/AppData/Local/Android/android-sdk\platforms\android-23\android.jar" -F bin/resources.ap_', CurrentDirectory='Temp/StagingArea'

I've tried:

  • Copying the aapt.exe shortcut from build tools to tools.

  • Installing both Java 64 and 86, copying the Java.exe from System32 to SysWOW64 (this is something I saw on a tutorial it may or not be pointless)

  • Installing API levels 8+ on SDK Manager

I'm at a complete loss now, I've no idea what to do. The error seems to be asking for the aapt.exe file, but I have created a shortcut from Build Tools to Tools. What else am I missing here?

Thanks in advance!

UPDATE

Also getting this: Win32Exception: ApplicationName='C:\Users\Kelly's User\AppData\Local\Android\android-sdk\build-tools\23.0.1\aapt.exe', CommandLine='package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/Kelly's User/AppData/Local/Android/android-sdk\platforms\android-23\android.jar" -F bin/resources.ap_', CurrentDirectory='Temp/StagingArea' System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) System.Diagnostics.Process.Start () (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start () UnityEditor.Utils.Program.Start () (at C:/buildslave/unity/build/Editor/Mono/Utils/Program.cs:33) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) UnityEditor.Android.PostProcessAndroidPlayer.Exec (System.String command, System.String args, System.String workingdir, System.String[] progress_strings, Single progress_value, System.String errorMsg) UnityEditor.Android.PostProcessAndroidPlayer.CompileResources (System.String stagingArea, System.String packageName, UnityEditor.Android.AndroidLibraries androidLibraries) UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options) UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args) UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316) UnityEditor.HostView:OnGUI()

Also getting this mess of words lol. Any ideas??

回答1:

Moved SDK folder to a simpler path in the C drive and it fixed the problem.



回答2:

Change the SDK location to root of any Drive or Simply a path which is not so long and doesn't contains any special characters in folder names.