“Win32Exception” while building the apk

Win32Exception: ApplicationName=‘D:\SDK’s\android-sdk-windows\build-tools\23.0.2\aapt.exe’ CommandLine='package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S “res” -I

I am getting this error when i am trying to build the apk in my office PC.

I am using unity 5.4.2 and JDK 1.7

Can anyone please help in this…?

I tired of this thing, can’t solve this error. I tried to find solution on google also, but none of solution worked for me as of now.

Any help will be appropriated.

Thank You.

It would seem your project is looking for aapt.exe at this location, and cannot find it?

Hi Billy,

Thanks for quick reply. I already check that and the “aapt.exe” is there inside the specified path.
You want me to put the whole error here?

What about these answers?

I already tried this solution yesterday itself, but didn’t worked for me.

Definitely, post the whole error, including especially the stderr part.

Sure here it is:

Win32Exception: ApplicationName=‘D:\SDK’s\android-sdk-windows\build-tools\23.0.2\aapt.exe’, CommandLine=‘package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S “res” -I “D:/SDK’s/android-sdk-windows\platforms\android-25\android.jar” -F bin/resources.ap_ --extra-packages com.google.vr.cardboard:vr.gvr.platform.unity -S “D:\Projects\VR\360Imags\VR_Walk_17_4_2017_2\VR_Walk\Temp\StagingArea\android-libraries\cardboard_android_common\res” -S “D:\Projects\VR\360Imags\VR_Walk_17_4_2017_2\VR_Walk\Temp\StagingArea\android-libraries\unityvractivity\res”’, 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.PostProcessor.Tasks.TasksCommon.Exec (System.String command, System.String args, System.String workingdir, System.String errorMsg, Int32 retiresOnFailure)
UnityEditor.Android.PostProcessor.Tasks.BuildResources.CompileResources (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.Tasks.BuildResources.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
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.RuntimeClassRegistry usedClassRegistry)
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, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:176)
UnityEditor.HostView:OnGUI()

Its is getting build properly in another PC.
This issue only in my PC.
Not only in this project. In other projects also i am getting same error.

Sure that apostrophe in the path name “…SDK’s…” is correct?

Other than that, all I can suggest is to delete and reinstall the android SDK.

Ya…it’s confirmed that the problem is in the SDK or in my system.
So i am going to redownload and reinstall the SDK and will keep it for update tonight and then i will test it tomorrow.
Will give you the update by tomorrow.

Thank You,

Hi,

I finally solved the problem.
It was my with system. I formatted my system and i installed unity it again, and i build the apk using same Android SDK.

Thanks for your Time and Support.

1 Like

I had the same problem replacing sdk files and deleting temp, library, obj folders worked for me.