Unity 2017.1 Android build error

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

Screenshots


Me too, I have try with new empty project. It’s still error!

Are you using Google Play Game Services? I have attached my editor log.

3141695–238378–Editor.txt (285 KB)

@John-Lisenby please submit a bug report and post the case # here. Thanks!

@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

I’m having the same error. Can’t build APK.

Looks like Android SDK Build Tools v.26.0.0 are missing the apksigner Google Issue Tracker

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.

3 Likes

Update: Google is planning to release a fixed version of build tools on 24th July. Until that, please use older tools.

4 Likes

Okay thanks for the update!

1 Like

Ohh Finally i found an anwser, thanks!

1 Like

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.

2 Likes

Oh I posted wrong download links! Fixing that - thanks for the heads up!

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/&%,:smile:sz” --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()

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()

1 Like

same that happen with me plz any help

I can confirm that the build tool 26.0.1 fixes the issue.

4 Likes

Unfortunately still having the issue with 2017.1.0f3 + 26.0.1, 25.0.0, 25.0.2, 25.0.3.
Copying apksigners didn’t work either.

If I build the same project with 2017.2.0b4 this time I get two errors that are different from the ones mentioned above.

Maybe it helps, the project is VR enabled and uses Google VR 1.60.


Error: Duplicate file(s) in apk: ‘D:\PROJECT_PATH\Temp\StagingArea\android-libraries\gvr\libs’

UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

CommandInvokationFailure: Failed to build apk.
C:/Program Files/Java/jdk1.8.0_131\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“C:/Users/Guney/AppData/Local/Android/sdk\tools” -Dfile.encoding=UTF8 -jar “C:\Program Files\Unity 2017.2.0b4\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar” -

stderr[
Error: Duplicate file(s) in apk: ‘D:\PROJECT_PATH\Temp\StagingArea\android-libraries\gvr\libs’
]
stdout[

]
exit code: 255
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[ ] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[ ] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Thanks a lot @gamepower7 . You saved our release which was almost stuck dead end:)

New Android build tools and Unity beta didn’t work but removing the special characters from both the keystore and key store resolved the issue.

1 Like