Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. Mirek Uhlir

    Mirek Uhlir

    Joined:
    Dec 25, 2009
    Posts:
    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

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

    Mirek Uhlir

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

    Abomb

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

    DannyDan

    Joined:
    Mar 22, 2010
    Posts:
    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

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

    claire-lee

    Joined:
    Sep 17, 2012
    Posts:
    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

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

    HunterKrech

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

    Hikarus Prime

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

    emrahsifoglu

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

    NaumanH

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

    1031exchange

    Joined:
    Mar 15, 2013
    Posts:
    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

    Joined:
    May 23, 2013
    Posts:
    4
    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

    Joined:
    Jul 3, 2012
    Posts:
    309

    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

    Joined:
    Jun 1, 2013
    Posts:
    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

    Joined:
    May 23, 2013
    Posts:
    4
    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

    Joined:
    Aug 14, 2012
    Posts:
    2


    can you share link for r21 for mac
     
  19. RRF_FPL

    RRF_FPL

    Joined:
    Jun 1, 2013
    Posts:
    3
  20. metameta_games

    metameta_games

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

    oa1234567

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

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    Find it here.
     
  23. Rixon

    Rixon

    Joined:
    Jun 11, 2013
    Posts:
    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

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

    HDaniel999

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

    CarlLydon

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

    danielng01

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

    naveen_pambi

    Joined:
    Jan 21, 2014
    Posts:
    9
    Check whether you are using the Mac Android SDK for Mac OS
    or Windows Android SDK for Windows OS
     
  29. Skyboard_Studios

    Skyboard_Studios

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

    Ziamark

    Joined:
    Jan 29, 2014
    Posts:
    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

    Joined:
    Sep 17, 2012
    Posts:
    3
    Thx Danny!
     
  32. zychatrix

    zychatrix

    Joined:
    Jun 29, 2014
    Posts:
    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

    Joined:
    Jun 16, 2014
    Posts:
    7
    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

    Joined:
    Oct 24, 2013
    Posts:
    110
    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

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

    jay-jin

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

    The problem is really sick!
     
  37. vickygroups

    vickygroups

    Joined:
    Apr 2, 2014
    Posts:
    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

    Joined:
    Jan 7, 2011
    Posts:
    168
    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

    Joined:
    Jul 15, 2014
    Posts:
    4
    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.
     
    yashpal likes this.
  40. BenoitFreslon

    BenoitFreslon

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

    Nub3h

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

    uanmanarmy

    Joined:
    Jan 22, 2014
    Posts:
    25
    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

    Joined:
    Jan 22, 2014
    Posts:
    25
    THQANK YOU, IT WORKED!
     
  44. codehesk

    codehesk

    Joined:
    Jun 16, 2014
    Posts:
    7

    I have resolved this issue! thanks
     
  45. keenanwoodall

    keenanwoodall

    Joined:
    May 30, 2014
    Posts:
    597
    That solved it for me!!!
     
  46. AbgaryanFX

    AbgaryanFX

    Joined:
    Jan 9, 2010
    Posts:
    167
    Hi, here is solution for mac which worked for me:

    Copy zipalign
    from: r21 sdk (link) / tools /
    to: r23 sdk / tools / and r23 sdk / build-tools / 19.0.1 /

    from r21 folder
    zipalign3.png

    to r23 folder 1
    zipalign2.png
    to r23 folder 2
    zipalign1.png
     
    milox777 likes this.
  47. drussilla

    drussilla

    Joined:
    Mar 20, 2014
    Posts:
    9
    Just add your Android SDK path in to PATH environment variable.
    Also do not forget to put zipalign.exe in right location as described here to prevent another offen error.
     
  48. dbrizov

    dbrizov

    Joined:
    Feb 22, 2014
    Posts:
    10
    The problem didn't fix with installing the x86 JDK. I fixed it by downgrading the Android SDK Tools.

    The 22.6.2 revision works fine. Don't install the 23.0 revision. I guess Unity has some incompatibilities with the new SDK Tools.

    Here are some links where you can download the tools for all operation systems:
    http://dl-ssl.google.com/android/repository/tools_r22.6.2-windows.zip
    http://dl-ssl.google.com/android/repository/tools_r22.6.2-linux.zip
    http://dl-ssl.google.com/android/repository/tools_r22.6.2-macosx.zip

    Just go to your Android SDK folder, rename the tools folder to tools1 to back it up. Then paste the new tools folder you just downloaded. This fixed it for me. I am with the latest JDK x64. I also added the path to the javaw.exe in the Envirements Variables under PATH. On my machine it's C:\Program Files\Java\jdk1.7.0_65\bin
     
    Last edited: Aug 4, 2014
    milox777 likes this.
  49. RFLG

    RFLG

    Joined:
    Feb 7, 2011
    Posts:
    153
    +1! Worked like a charm, thanks!

    This sort of issues is why I hate to setup new dev environments :p
     
  50. djoshi

    djoshi

    Joined:
    Mar 28, 2014
    Posts:
    182
    I ran into big trouble...here....

    I have got blue screen of death after following up your instruction guys...

    1) I have copied & replaced java.exe from system32 to syswow64.
    2) Updated SDK & eclipse as well.
    3) I could not find any zipalign.exe file in my entire system then I found that I have only installed build- tool 19 so tried installing 20, & while doing this my system crashed with blue screen" IRQL_NOT_LESS_OR_EQUAL Error".
    4) Than tried repairing windows, Safe mode etc... & ultimately everything dead now..No display.......

    I can attach that hard disk to other PC & can see all my data. Can someone suggest me if I can do something from there & can get my system alive again OR only formatting is the option??

    Please save me.....!!