Error building Player: Win32Exception: ApplicationName='java.exe',

Discussion in 'Android Development' started by Mirek Uhlir, Mar 4, 2011.

  1. Mirek Uhlir

    Mirek Uhlir

    New Member

    Joined:
    Dec 25, 2009
    Messages:
    124
    I bought an Android license. I can not make a build.
    I am getting this error.
    Code (csharp):
    1. Error building Player: Win32Exception: ApplicationName='java.exe', CommandLine='-Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk\tools" -classpath "C:/Program Files (x86)/Android/android-sdk\tools\lib\sdkmanager.jar" com.android.sdkmanager.Main list targets', CurrentDirectory=''
    2. UnityEditor.HostView:OnGUI()
    I have installed Android SDK and set path to SDK in Unity.
    Last edited: Mar 4, 2011
  2. Abomb

    Abomb

    Member

    Joined:
    Feb 20, 2010
    Messages:
    27
    I'm using the android trial but get the same error.
    Any solution for this?
  3. Mirek Uhlir

    Mirek Uhlir

    New Member

    Joined:
    Dec 25, 2009
    Messages:
    124
  4. Abomb

    Abomb

    Member

    Joined:
    Feb 20, 2010
    Messages:
    27
    After reinstalling java JDK and the Android SDK everything works now.
  5. DannyDan

    DannyDan

    New Member

    Joined:
    Mar 22, 2010
    Messages:
    27
    Hi.

    Had the same problem yesterday. I solved it by installing the 32bit of the JDK. First I only had installed the 64bit Version.
    Maybe this will also help you.

    Danny
  6. met44

    met44

    New Member

    Joined:
    May 3, 2011
    Messages:
    2
    Thx Danny, worked for me too !
  7. claire.lee

    claire.lee

    New Member

    Joined:
    Sep 17, 2012
    Messages:
    4
    I also had the same error. In this case, Just copy java.exe. file out of c:\windows\system32 and then paste into c:\windows\syswow64

    It would help your problem :)
  8. Unislash

    Unislash

    New Member

    Joined:
    Jan 4, 2011
    Messages:
    33
    Works like a charm, and I didn't even need to restart :) Thanks!
  9. HunterKrech

    HunterKrech

    New Member

    Joined:
    Aug 22, 2012
    Messages:
    8
    yessss! Thank you so much finally worked!
  10. Hikarus Prime

    Hikarus Prime

    Member

    Joined:
    Dec 13, 2012
    Messages:
    1
    Thank you very much guys and gals. You rule!
    GODSPEED!
  11. emrahsifoglu

    emrahsifoglu

    New Member

    Joined:
    Jan 27, 2013
    Messages:
    3
    Thanks for the advice. It worked!
  12. NaumanH

    NaumanH

    New Member

    Joined:
    Jul 10, 2012
    Messages:
    5
    Thanks :D, installing x86 (32bit) solved error.
  13. 1031exchange

    1031exchange

    New Member

    Joined:
    Mar 15, 2013
    Messages:
    1
    This definitely worked, thanks! ;) Somebody should put these critical advice on the manual b/c I don't know where I'd be without finding this answer on the the community boards
  14. seba88

    seba88

    New Member

    Joined:
    May 23, 2013
    Messages:
    3
    please help me with this problem!! when I buld an android project I have this problem: Exception: Error building Player: Win32Exception: ApplicationName='C:/Program Files (x86)/Android/android-sdktoolsapkbuilder.bat', CommandLine='"C:UserssebaDocumentswaterfallHDTemp/StagingArea/Packageunaligned.apk" -v -z "C:UserssebaDocumentswaterfallHDTemp/StagingArea/assets.ap" -z "C:UserssebaDocumentswaterfallHDTemp/StagingArea/bin/resources.ap_" -nf "C:UserssebaDocumentswaterfallHDTemp/StagingArea/libs" -f "C:UserssebaDocumentswaterfallHDTemp/StagingArea/bin/classes.dex"', CurrentDirectory='Temp/StagingArea' UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:367) UnityEditor.BuildPlayerWindow.GUIBuildButtons (Boolean enableBuildButton, Boolean enableBuildAndRunButton, Boolean canInstallInBuildFolder) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:972) UnityEditor.BuildPlayerWindow.ShowBuildTargetSettings () (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:953) UnityEditor.BuildPlayerWindow.OnGUI () (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:726) 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. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/GUI/DockArea.cs:225) UnityEditor.HostView.Invoke (System.String methodName) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/GUI/DockArea.cs:218) UnityEditor.HostView.OnGUI () (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/GUI/DockArea.cs:119)...
    please help!!!!
  15. MicroEyes

    MicroEyes

    Member

    Joined:
    Jul 3, 2012
    Messages:
    243

    Seems like you have updated your Android SDK to r22. r22 has some thing which are not compatible with Unity. I had the same bug. Revert back to r21 will solve your issue.
  16. RRF_FPL

    RRF_FPL

    New Member

    Joined:
    Jun 1, 2013
    Messages:
    3
    I'm getting the same error on my Mac, I've tried reinstalling JDK, JRE, Unity and Android SDK, also downgraded to rev-21 of sdk tools.
    The full error:
    Can anyone think of why this is happening?

    Thanks
  17. seba88

    seba88

    New Member

    Joined:
    May 23, 2013
    Messages:
    3
    I solved guys, just to downgrade the SDK for Android .... do not install this update android sdk tools rev.22 ... reinstall rev 21 and it will work fine...but now I have another problem ... I have installed on my pc unity 3.4.2f2, android sdk, java jdk and eclipse.
    in unity I have no problem, I build the project, the export as live wallpaper in eclipse.
    when I import the project into eclipse, I have no errors, no red exclamation mark, it all seems ok, but when I install the live wallpaper on my Nexus 4 or samsung s3, try to open it but I get this error "the application is locked in an unusual way "... please let help me ... probably my version of eclipse is wrong, I did not install some plugins ... please let tell me what version of eclipse you are using ... thank you very much and sorry for my english. ..
  18. swatitelang

    swatitelang

    New Member

    Joined:
    Aug 14, 2012
    Messages:
    2


    can you share link for r21 for mac
  19. RRF_FPL

    RRF_FPL

    New Member

    Joined:
    Jun 1, 2013
    Messages:
    3
  20. Evansbsr

    Evansbsr

    New Member

    Joined:
    Jun 8, 2013
    Messages:
    1
    IT WORKS!!! Thanks a lot
  21. oa1234567

    oa1234567

    New Member

    Joined:
    Jun 29, 2013
    Messages:
    1
    can anyone please share a link for revision 21 for windows?
  22. MicroEyes

    MicroEyes

    Member

    Joined:
    Jul 3, 2012
    Messages:
    243
    Find it here.
  23. Rixon

    Rixon

    New Member

    Joined:
    Jun 11, 2013
    Messages:
    2
    i have this problem when i start to build my game.. please help me..

    Exception: Error building Player: Win32Exception: ApplicationName='C:/Users/Rixon/Documents/android-sdk-windows/platforms/android-17\aapt.exe', CommandLine='package -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/Rixon/Documents/android-sdk-windows/platforms/android-17\android.jar" -F bin/resources.ap_', CurrentDirectory='Temp/StagingArea'
    UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:367)
    UnityEditor.BuildPlayerWindow.GUIBuildButtons (Boolean enableBuildButton, Boolean enableBuildAndRunButton, Boolean canInstallInBuildFolder) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:972)
  24. Woodii

    Woodii

    New Member

    Joined:
    Jul 12, 2013
    Messages:
    1
    Wow! It works.
    Thank a lot.
    (But, I'm curious what makes the problem.)
  25. HDaniel999

    HDaniel999

    New Member

    Joined:
    Oct 2, 2013
    Messages:
    1
    I have exactly the same error, I don't know what to do, did you find out what was wrong? :/
  26. CarlLydon

    CarlLydon

    Member

    Joined:
    Oct 9, 2012
    Messages:
    13
    What would a mac person do in this instance? Since I don't have a java.exe
  27. danielng01

    danielng01

    Member

    Joined:
    Sep 1, 2013
    Messages:
    2
    Setting the JAVA_HOME variable fixed the issue for me : )
  28. naveen_pambi

    naveen_pambi

    New Member

    Joined:
    Jan 21, 2014
    Messages:
    4
    Check whether you are using the Mac Android SDK for Mac OS
    or Windows Android SDK for Windows OS
  29. SkyboardSoftware

    SkyboardSoftware

    New Member

    Joined:
    Jul 20, 2013
    Messages:
    4
    yes the proper java installation and path setting is the key. nice to have it working!
  30. Ziamark

    Ziamark

    New Member

    Joined:
    Jan 29, 2014
    Messages:
    11
    Thank you sir, this worked for me too. I now have both the 64bit and 32bit. I believe since unity is 32bit, the 64bit java is pointless.
  31. gygabor

    gygabor

    New Member

    Joined:
    Sep 17, 2012
    Messages:
    1
    Thx Danny!
  32. zychatrix

    zychatrix

    Member

    Joined:
    Jun 29, 2014
    Messages:
    1
    People getting the aapt.exe error. Try to search the Android SDK directory for the file aapt.exe. In the later versions, it was moved to android-sdk/build-tools/18.0.0/. Look there and, if you find it, copy it from there to your android-sdk/platforms/android-18 folder.
  33. codehesk

    codehesk

    Member

    Joined:
    Jun 16, 2014
    Messages:
    5
    please help me with this .....

    Error building Player: Win32Exception: ApplicationName='M:/installed/androidstudio/sdk\tools\zipalign.exe', CommandLine='4 "F:\unity_projects\BS\project\Temp/StagingArea/Package_unaligned.apk" "F:\unity_projects\BS\project\Temp/StagingArea/Package.apk"', CurrentDirectory='Temp/StagingArea'


    AndroidSDK Tool. rev 23
    Last edited: Jul 8, 2014
  34. Dudledok

    Dudledok

    Member

    Joined:
    Oct 24, 2013
    Messages:
    1
    I just had the same error. I copied the zipalign.exe from "..\android-sdk\build-tools\20.0.0" into "..\android-sdk\tools"
    keenanwoodall and Shiftyminds like this.
  35. OpherV

    OpherV

    Member

    Joined:
    Jul 9, 2014
    Messages:
    1
    Dudledok - thanks. Copying zipalign.exe solved it for me.
    codehesk likes this.
  36. jay.jin

    jay.jin

    Member

    Joined:
    Jun 22, 2014
    Messages:
    2
    Dudledok - thanks. Copying zipalign.exe solved it for me too!

    The problem is really sick!
  37. vickygroups

    vickygroups

    Member

    Joined:
    Apr 2, 2014
    Messages:
    16
    I've been having the same error, among others, only building Android on Mac. Can you please point to the best Java download for Mac? I assume I should try a reinstall?
  38. BeforeTheLight

    BeforeTheLight

    Member

    Joined:
    Jan 7, 2011
    Messages:
    117
    On my Mac I could not update ADT and was required to use the latest tools have 23.0.2 ADT. I had to fully remove ADT and then setup ADT again. I had the exact issues here Exception: Error building Player: Win32Exception: where the exception was from zip align.exe. I followed the advice above to copy the zip align from build tools to tools and was able to build for android again! Thanks guys.
  39. thekingofclubs

    thekingofclubs

    Member

    Joined:
    Jul 15, 2014
    Messages:
    1
    So basically it looks like, if you get Win32Exception errors when building for Android, you just have to find the exe file in question and copy it to "tools" folder under Android-sdk-windows. Newer SDKs of Android are moving things around too much! I had the zipalign.exe error... copied it to tools, error gone.
  40. badben

    badben

    Member

    Joined:
    Jan 16, 2013
    Messages:
    38
    I downloaded and installed the last version of Android SDK and it worked for me.
  41. Nub3h

    Nub3h

    Member

    Joined:
    Aug 23, 2012
    Messages:
    49
    I still have the issue on Mac with the latest version of Unity and Android SDK.
  42. uanmanarmy

    uanmanarmy

    Member

    Joined:
    Jan 22, 2014
    Messages:
    7
    Error building Player: Win32Exception: ApplicationName='C:/androidSDK/adt-bundle-windows-x86_64-20140702/sdk\tools\zipalign.exe', CommandLine='4 "D:\Practica\3MatchStudentGame\Temp/StagingArea/Package_unaligned.apk" "D:\Practica\3MatchStudentGame\Temp/StagingArea/Package.apk"', CurrentDirectory='Temp/StagingArea'

    I need help with this one!!
  43. uanmanarmy

    uanmanarmy

    Member

    Joined:
    Jan 22, 2014
    Messages:
    7
    THQANK YOU, IT WORKED!
  44. codehesk

    codehesk

    Member

    Joined:
    Jun 16, 2014
    Messages:
    5

    I have resolved this issue! thanks
  45. keenanwoodall

    keenanwoodall

    Member

    Joined:
    May 30, 2014
    Messages:
    115
    That solved it for me!!!