Search Unity

SOLVED--Error building Player: CommandInvokationFailure: Failed to build apk.

Discussion in 'Editor & General Support' started by shawnrevels, Jul 14, 2015.

  1. shawnrevels

    shawnrevels

    Joined:
    Aug 13, 2014
    Posts:
    86
    Any one!!!?? Ive searched for days for the answer but i cannot figure it out. Ive downloaded alllll referenced files and ive referenced them inside enviroment variables. I have sdk rev 21, and newest jdk as well as jdk 7. Ive tried Sdk rev 21 and 22. And jdk 32 and 64 bit versions. Ive referenced the, in prefrences inside unity. Ive done it all. This is the error.

    Error building Player: CommandInvokationFailure: Failed to build apk. See the Console for details.
    C:/Program Files/Java/jdk1.7.0_79\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk-windows\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

    stderr[
    Error: Not a file '
    'C:\Users\shawnrevels\Documents\Vision'
    ]
    stdout[
     
    Er_ellison and manuel-font like this.
  2. shawnrevels

    shawnrevels

    Joined:
    Aug 13, 2014
    Posts:
    86
    Solved, Moved a file from build tools to tools in sdk. and i forgot to add keystore file to developer settings.
     
    manuel-font likes this.
  3. sharose

    sharose

    Joined:
    Sep 23, 2017
    Posts:
    1
    which file .......?
    plz reply as earlier as possible ..really.....stucked
     
  4. whitelittle

    whitelittle

    Joined:
    Apr 17, 2017
    Posts:
    1
    'zipalign.exe' file, copy it from build tools folder to tools folder, and make sure you set up the keystore file in player settings.
     
  5. rodolfo161280

    rodolfo161280

    Joined:
    Sep 28, 2017
    Posts:
    1
    This was driving me crazy. Thanks for the solution!!!!
     
  6. soydev

    soydev

    Joined:
    Sep 14, 2017
    Posts:
    1
    In my case I changed from JDK v9 to JDK v8 in Edit->Preferences...->External Tools (Android Section) and it works perfectly.
     

    Attached Files:

  7. Wout_BlinkBlink

    Wout_BlinkBlink

    Joined:
    Dec 19, 2016
    Posts:
    3
    This worked for me as well - downgrading from JDK9 to JDK8. Unity version 5.6. Jesus christ the hoops you have to jump through these days to get a simple Android build working.
     
  8. MetaZhi

    MetaZhi

    Joined:
    Feb 18, 2013
    Posts:
    28
    Thank you very much! Build successfully after downgrading from JDK9 to JDK8. Unity 2017.01
     
    kuke119 and tsondhi2006 like this.
  9. lernoh

    lernoh

    Joined:
    Oct 12, 2017
    Posts:
    3
    I have the same problem ... Couldn't you please tell me should I delete the JDK-9.0.1 and download JDK 8u151?
    ... or something else must be done?
     
    Er_ellison likes this.
  10. lernoh

    lernoh

    Joined:
    Oct 12, 2017
    Posts:
    3
    Guys i don't have any 'zipalign.exe' file here ... as well as build tools folder, but I have downloaded from unity link ... What can i do ?
     
  11. LeMorrow

    LeMorrow

    Joined:
    Jun 16, 2017
    Posts:
    3
    I didn't have a keystore, I didn't move the zipalign.exe file. All I did was downgrading JDK 9.0 to JDK 8.0 and everything built properly. Thank you soydev!
     
  12. enes23

    enes23

    Joined:
    Nov 1, 2016
    Posts:
    3
    When I changed java 9 to java8u151 , build successfully , thanks !!!
     
  13. tisbrat

    tisbrat

    Joined:
    Nov 20, 2017
    Posts:
    2
    Thank you so much! This worked for me...changing to JDK v8 the updated version.
     
    Asadullah4445 likes this.
  14. KLN_TBN

    KLN_TBN

    Joined:
    Nov 26, 2017
    Posts:
    5
    I had this problem and this worked for me too! My first running android game! THANKS AGAIN!
     
  15. vbharath

    vbharath

    Joined:
    Dec 23, 2017
    Posts:
    1
    You Are Great!
     
  16. EvyBenita

    EvyBenita

    Joined:
    Aug 8, 2015
    Posts:
    4
    I love you.
     
  17. Alesha6886

    Alesha6886

    Joined:
    Apr 4, 2016
    Posts:
    1
    [QUOTE = "soydev, post: 3253165, member: 1514348"] В моем случае я изменился с JDK v9 на JDK v8 в Edit-> Preferences ...-> External Tools (Android Section), и он отлично работает. [/ QUOTE ]
    Спасибо огромное всё получилось
     
  18. supriyalocked

    supriyalocked

    Joined:
    Mar 23, 2018
    Posts:
    1
    i literally tried for two days, and it was just the JDK-8

    -_-
     
  19. ahmedelbanawy100

    ahmedelbanawy100

    Joined:
    Apr 5, 2018
    Posts:
    1
    i just failed to build afk file after downloading the whole jdk files nothink works
    i quite before start
     
  20. DIP123

    DIP123

    Joined:
    Nov 6, 2017
    Posts:
    3
    This solve the problem
     

    Attached Files:

  21. Shayke

    Shayke

    Joined:
    Dec 8, 2017
    Posts:
    352
    I have 2 folders in build tools.
    And in tools i have zipalign too.
    What should i do?
     
  22. unitr

    unitr

    Joined:
    Mar 2, 2018
    Posts:
    3
    Can confirm, downgrade to JDK-8-u171
    worked immediately.
     
  23. Lendis12

    Lendis12

    Joined:
    Jun 13, 2018
    Posts:
    3
    OK but which java version?
     
  24. Lendis12

    Lendis12

    Joined:
    Jun 13, 2018
    Posts:
    3
    easy...
     
  25. Hilalsaif1211

    Hilalsaif1211

    Joined:
    Jul 28, 2018
    Posts:
    1
    you are the best,,thank you
     
  26. flickilloway

    flickilloway

    Joined:
    Sep 19, 2018
    Posts:
    1
    This fixed mine too, thanks!
     
  27. pcajantha

    pcajantha

    Joined:
    Oct 28, 2018
    Posts:
    1
    thanks lot......... very helpful...
     
  28. GuardianKarma

    GuardianKarma

    Joined:
    Nov 20, 2018
    Posts:
    1
    Error building Player: CommandInvokationFailure: Failed to build apk. See the Console for details.
    C:/Program Files/Java/jdk-11.0.1\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/Fatih/AppData/Local/Android/Sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

    I TRIED EVERYTHING KEYTHING,JDK8THING AND MOVING A FOLDER FROM BUİLD TOOL TO TOOL STILL SAMEE PLEASE HELP
     
    mahima_mangal likes this.
  29. mahima_mangal

    mahima_mangal

    Joined:
    Mar 7, 2019
    Posts:
    1
    SAME HERE!
    PLEASE HELP.
     
    kuke119 likes this.
  30. Oimiakon

    Oimiakon

    Joined:
    Jul 2, 2019
    Posts:
    1
    Same problem!!
    plz could someone helpT T
    It's driving me crazy
     
  31. KnightRiderGuy

    KnightRiderGuy

    Joined:
    Nov 23, 2014
    Posts:
    515
    Same here, I've tried all kinds of suggested crap and I still get the same error. I'm using Unity 5.6.3f1 on Windows 10 for what that's worth.... has anyone been able to get this crap to work!!??
     
  32. kuke119

    kuke119

    Joined:
    Feb 11, 2020
    Posts:
    2




    bro the error says you are still using a higher version of java that is 11.0.1
     
  33. kuke119

    kuke119

    Joined:
    Feb 11, 2020
    Posts:
    2
    bruh it worked great.. thnaks a lot
    #saved_my_day
     
  34. shehansallay

    shehansallay

    Joined:
    Apr 13, 2020
    Posts:
    3
    Error building Player because scripts had compiler errors
    how to fix it
     

    Attached Files:

    • 1.png
      1.png
      File size:
      178.6 KB
      Views:
      472