Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Bug
Enter Task Name: Android Signing
Server - Azure Pipelines
Agent - Hosted:
Android Signing task - 'zipalign' failed with exit code 1
Sign the APK, I get same error.I've attached ZIP folder containing:
I've done some more investigating...
I've removed all apksigner arguments as they're default anyway, and unticked zipalign checkbox:

Now I get this error:
##[section]Starting: Signing and aligning APK file(s) **/*.apk
==============================================================================
Task : Android Signing
Description : Sign and align Android APK files
Version : 3.151.0
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613717)
==============================================================================
[command]/Users/vsts/Library/Android/sdk/build-tools/24.0.3/apksigner sign --ks /Users/vsts/agent/2.150.3/work/_temp/***.jks --ks-pass pass:*** --ks-key-alias *** --key-pass pass:*** /Users/vsts/agent/2.150.3/work/1/s/android/app/build/outputs/apk/debug/app-debug.apk
Failed to load signer "signer #1": /Users/vsts/agent/2.150.3/work/_temp/***.jks entry "***" does not contain a key
##[error]Error: The process '/Users/vsts/Library/Android/sdk/build-tools/24.0.3/apksigner' failed with exit code 2
##[section]Finishing: Signing and aligning APK file(s) **/*.apk
I installed keystore explorer to view my keystore:

Does this look correct?
To summarise:
exit code 1 as per my 1st comment / description. Zipalign checkbox, signing the APK fails as per my 2nd comment.Getting the same error: ##[error]Error: The process '/Users/runner/Library/Android/sdk/build-tools/19.1.0/zipalign' failed with exit code 1
@basher
The issue with disabled zipalign seems to be related to incorrect key alias - as I see in task input parameters alias is set as 'omniui', but on keystore explorer screenshot it's 'key0' (this is default value in Android Studio when you generate keystore file). Could you please try to generate keystore file and set necessary alias or set 'Alias' task input parameter as 'key0'?
It also looks like related to debug/release build variants - zipalign doesn't work properly with debug version of apk file (at least for me... investigating ). Could you please try it with release build?
@anatolybolshakov
Thanks - but I'm no longer working for that company.
@lukaszgrela - you might want to look at this?
@LukaszGrela @sideez could you please let us know if this issue is still actual for you?
HI,
we've actually dropped this, so can't confirm or dismiss this issue. You
can close it though.
czw., 7 maj 2020 o 15:57 Anatoly Bolshakov notifications@github.com
napisał(a):
@LukaszGrela https://github.com/LukaszGrela @sideez
https://github.com/sideez could you please let us know if this issue is
still actual for you?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/azure-pipelines-tasks/issues/10574#issuecomment-625307001,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AB2KDR6IRBHLKOHPTX2AZ3LRQLD7FANCNFSM4HS3HT3Q
.
HI,
we've actually dropped this, so can't confirm or dismiss this issue. You
can close it though.czw., 7 maj 2020 o 15:57 Anatoly Bolshakov notifications@github.com
napisał(a):@LukaszGrela https://github.com/LukaszGrela @sideez
https://github.com/sideez could you please let us know if this issue is
still actual for you?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/azure-pipelines-tasks/issues/10574#issuecomment-625307001,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AB2KDR6IRBHLKOHPTX2AZ3LRQLD7FANCNFSM4HS3HT3Q
.
You may close it as I am unable to confirm at this time if the issue is related to AndroidSigningTask or project. Need more time to investigate.
Thanks! I'm closing it as not reproducible at the moment
FYI: changing the alias to key0 didnt resolved the issue, zipaligining was complaining on some of the PNG files in resources, I also changed the gradlew to assembleRelease and this time it worked! go figure
Please can this be re-opened? this is happening to me on every build for some reason, same exact thing.. zipalign fail with exit code 1, complaining on some of the PNG files in resources - my gradlew is already set to assembleRelease - the zipalign fails whether I've set to assembleDebug or assembleRelease..
just started happening randomly, it used to build fine.. it builds fine in the local IDE android studio - what is going on with the pipeline?!
Hi @LukaszGrela @android-dataticket could you please check that you're building app in release configuration? This error seems to be different from mentioned in this ticket and usually happens with apk built in debug configuration.
Hi @LukaszGrela @android-dataticket could you please check that you're building app in release configuration? This error seems to be different from mentioned in this ticket and usually happens with apk built in debug configuration.
I can confirm we are using assembleRelease and it is still failing.
@android-dataticket This issue doesn't seem to be related to zipalign task - could you please try to check tools versions compatibility? If it doesn't help - I would recommend to fill in a ticket on https://issuetracker.google.com/issues to get the right eyes on it
@android-dataticket This issue doesn't seem to be related to zipalign task - could you please try to check tools versions compatibility? If it doesn't help - I would recommend to fill in a ticket on https://issuetracker.google.com/issues to get the right eyes on it
ok so - when I change the gradle plugin version in the app level build.gradle file from 4.1.1 to 4.0.0, it builds successfully....
how weird.. because I'm still using gradle 6.5.. and gradle plugin 4.0.0 says it needs gradle 6.1.1 to run... but all I did was change the gradle plugin to 4.0.0 and left the gradle version at 6.5 and it built/zipaligned successfully...
again just to reiterate, the project builds signed apk successfully with gradle plugin 4.1.1 and gradle 6.5 in android studio locally.. just having weird behavior with azure pipeline
@android-dataticket there already is an issue reported: https://issuetracker.google.com/issues/162117652
It seems that zipalign is not needed anymore.
@android-dataticket there already is an issue reported: https://issuetracker.google.com/issues/162117652
It seems that zipalign is not needed anymore.
cheers to this, thank you very much, this thread was enlightening!
Most helpful comment
cheers to this, thank you very much, this thread was enlightening!