Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

“Win32Exception” while building the apk

Discussion in 'Editor & General Support' started by Dhaval1992, Apr 19, 2017.

  1. Dhaval1992

    Dhaval1992

    Joined:
    Apr 18, 2017
    Posts:
    8
    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.
     
  2. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,564
    It would seem your project is looking for aapt.exe at this location, and cannot find it?
     
  3. Dhaval1992

    Dhaval1992

    Joined:
    Apr 18, 2017
    Posts:
    8
    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?
     
  4. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,564
  5. Dhaval1992

    Dhaval1992

    Joined:
    Apr 18, 2017
    Posts:
    8
    I already tried this solution yesterday itself, but didn't worked for me.
     
  6. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,564
    Definitely, post the whole error, including especially the stderr part.
     
  7. Dhaval1992

    Dhaval1992

    Joined:
    Apr 18, 2017
    Posts:
    8
    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.
     
  8. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,564
    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.
     
  9. Dhaval1992

    Dhaval1992

    Joined:
    Apr 18, 2017
    Posts:
    8
    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,
     
  10. Dhaval1992

    Dhaval1992

    Joined:
    Apr 18, 2017
    Posts:
    8
    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.
     
    Billy4184 likes this.
  11. karansethi1595

    karansethi1595

    Joined:
    Mar 11, 2018
    Posts:
    1
    I had the same problem replacing sdk files and deleting temp, library, obj folders worked for me.
     
unityunity