1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  4. Unity 2017.1 is now released.
    Dismiss Notice
  5. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice

Unity 2017.1 Android build error

Discussion in 'Android' started by John-Lisenby, Jul 11, 2017.

  1. John-Lisenby

    John-Lisenby

    Joined:
    Nov 8, 2013
    Posts:
    49
    Hello,

    I just updated to Unity 2017.1.0f3 and when I try to build my APK using Internal (default) I'm getting error messages. I read that Android signing process was updated, and is there any thing new I need to do to make it build in Unity 2017? I had no issues build the same APK in Unity 5.6.

    I have attached screen shots.

    Thanks,

    John

    [​IMG] [​IMG]
     
  2. John-Lisenby

    John-Lisenby

    Joined:
    Nov 8, 2013
    Posts:
    49
    Screenshots
     

    Attached Files:

  3. nguyenthanhliemfc

    nguyenthanhliemfc

    Joined:
    Dec 28, 2016
    Posts:
    18
    Me too, I have try with new empty project. It's still error!
     
  4. John-Lisenby

    John-Lisenby

    Joined:
    Nov 8, 2013
    Posts:
    49
    Are you using Google Play Game Services? I have attached my editor log.
     

    Attached Files:

    Last edited: Jul 12, 2017
  5. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    562
    @John-Lisenby please submit a bug report and post the case # here. Thanks!
     
  6. John-Lisenby

    John-Lisenby

    Joined:
    Nov 8, 2013
    Posts:
    49
    @Yury-Habets

    have uploaded a bug report and the number is 930255
    I have tested and it seems if a keystore is used it errors out. If no keystore is used it build the apk without issues.

    Thanks,

    John
     
  7. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    253
    I'm having the same error. Can't build APK.
     
  8. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    562
    Looks like Android SDK Build Tools v.26.0.0 are missing the apksigner https://issuetracker.google.com/issues/62696222

    Please remove them and download and use the earlier version of the build tools for the meanwhile, for example by using Android Studio SDK Manager UI.

    We are getting in touch with Google about it.
     
    Last edited: Jul 17, 2017 at 9:56 AM
  9. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    562
    Update: Google is planning to release a fixed version of build tools on 24th July. Until that, please use older tools.
     
    Daggerwock likes this.
  10. John-Lisenby

    John-Lisenby

    Joined:
    Nov 8, 2013
    Posts:
    49
    Okay thanks for the update!
     
  11. Dannark

    Dannark

    Joined:
    Jul 24, 2016
    Posts:
    4
    Ohh Finally i found an anwser, thanks!
     
  12. Daggerwock

    Daggerwock

    Joined:
    Mar 9, 2015
    Posts:
    6
    Yury-Habets' workaround didn't work for me.
    But this one worked
    Changing tools folder wasn't necessary for me, I'm using tools v.26.0.2.


    UDP
    Ok, now I see that Yury-Habets didn't mean to change tools folder, he was talking about build-tools folder, but mistakenly gave download links to older tools folder.
    All you need is to download a previous version of build-tools using Android Studio SDK Manager and do as quoted.
     
    Last edited: Jul 16, 2017 at 11:54 AM
  13. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    562
    Oh I posted wrong download links! Fixing that - thanks for the heads up!
     
  14. gamepower7

    gamepower7

    Joined:
    May 16, 2017
    Posts:
    7
    hi ,
    I've applied the workaround , and got this error

    CommandInvokationFailure: Failed to sign APK package.
    D:\Android\sdk\build-tools\25.0.3\apksigner.bat sign --ks "D:/Work/GamePower7.keystore" --ks-pass pass:"V,Tmqm5DXJ$j/&%,:Dsz" --ks-key-alias "damar on lin" --key-pass pass:"~w#FV3ua;fCeGIE~3zIh" "C:\Users\h.safa\Source\Workspaces\BagoonV5\BagoonV5\Temp/StagingArea/Package.apk"

    stderr[
    Failed to load signer "signer #1"
    java.io.IOException: Keystore was tampered with, or password was incorrect
    at sun.security.provider.JavaKeyStore.engineLoad(Unknown Source)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(Unknown Source)
    at sun.security.provider.KeyStoreDelegator.engineLoad(Unknown Source)
    at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(Unknown Source)
    at java.security.KeyStore.load(Unknown Source)
    at com.android.apksigner.ApkSignerTool$SignerParams.loadKeyStoreFromFile(ApkSignerTool.java:734)
    at com.android.apksigner.ApkSignerTool$SignerParams.loadPrivateKeyAndCertsFromKeyStore(ApkSignerTool.java:636)
    at com.android.apksigner.ApkSignerTool$SignerParams.loadPrivateKeyAndCerts(ApkSignerTool.java:580)
    at com.android.apksigner.ApkSignerTool$SignerParams.access$200(ApkSignerTool.java:534)
    at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:229)
    at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:87)
    Caused by: java.security.UnrecoverableKeyException: Password verification failed
    ... 11 more
    ]
    stdout[

    ]
    exit code: 2
    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 retriesOnFailure)
    UnityEditor.HostView:OnGUI()


    ---


    UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83
    UnityEditor.HostView:OnGUI()
     
    Last edited: Jul 17, 2017 at 12:16 PM
  15. gamepower7

    gamepower7

    Joined:
    May 16, 2017
    Posts:
    7
    after some test , i found that if i signed apk with keystore with long password , this error happed ,
    if the password was simple , no error found

    create keystore with this password -> got error

    HZjW3D_Nz7ClF$~lJfU$fSUuH\adGR
    q!E"?*0nrvV'/mA#Bn3l0|_W=$eFxk


    create keystore with this password -> worked
    Pass@Word123
    Pass@word123

    can any one confirm ?

    bug

    CommandInvokationFailure: Failed to sign APK package.
    D:\Android\sdk\build-tools\25.0.3\apksigner.bat sign --ks "D:/user.keystore" --ks-pass pass:"HZjW3D_Nz7ClF$~lJfU$fSUuH\adGR" --ks-key-alias "meme" --key-pass pass:"q!E"?*0nrvV'/mA#Bn3l0|_W=$eFxk" "C:\Users\h.safa\Source\Workspaces\BagoonV5\BagoonV5\Temp/StagingArea/Package.apk"

    stderr[
    '_W' is not recognized as an internal or external command,
    operable program or batch file.
    ]
    stdout[

    ]
    exit code: 255
    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 retriesOnFailure)
    UnityEditor.HostView:OnGUI()
     
  16. hero87

    hero87

    Joined:
    Dec 12, 2016
    Posts:
    2
    same that happen with me plz any help