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
list here (V# not needed):
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks
The "Android signing" is failing when performing "Zip Align" with exit code 1.
the logs show that there are PNG files with "BAD-1" to "BAD-3".
Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting
2020-11-09T08:55:54.4131160Z 14816780 res/anim/nav_default_exit_anim.xml (OK - compressed)
2020-11-09T08:55:54.4131630Z 14817121 res/drawable-hdpi-v4/abc_textfield_activated_mtrl_alpha.9.png (BAD - 1)
2020-11-09T08:55:54.4132090Z 14817391 res/drawable-xhdpi-v4/common_full_open_on_phone.png (BAD - 3)
2020-11-09T08:55:54.4132550Z 14817963 res/layout/notification_template_big_media_narrow.xml (OK - compressed)
2020-11-09T08:55:54.4133000Z 14818691 res/xml/standalone_badge_offset.xml (OK - compressed)
2020-11-09T08:55:54.4133440Z 14818987 res/drawable/abc_seekbar_tick_mark_material.xml (OK - compressed)
2020-11-09T08:55:54.4133880Z 14819311 res/drawable-hdpi-v4/notification_bg_normal.9.png (BAD - 3)
2020-11-09T08:55:54.4134080Z Verification FAILED
2020-11-09T08:55:54.4134850Z ##[debug]Exit code 1 received from tool '/Users/macserver/Library/Android/sdk/build-tools/28.0.3/zipalign'
Hi @Liran-Dobrish could you please check that you're building app in release configuration? This error with zipalign usually happens with apk built in debug configuration.
Hi @anatolybolshakov ,
i first run "/Users/macserver/Agents/Mac_Ag2/_work/10/s/MobileDemoApp/gradlew clean --quiet"
and then "/Users/macserver/Agents/Mac_Ag2/_work/10/s/MobileDemoApp/gradlew assembleRelease"
all the logs in diagnostic mode are available in a link about the issue
@Liran-Dobrish could you please check also that it works locally without any issues? We can't reproduce it at the moment...
actually if i run the same command used by the task from a console it also fails with the same errors.
i usually don't work with mac and XCode so I'm mostly using "google" to solve most issues with the pipeline.
I also start having this zipalign issue after updating my gradle version to 4.1.1 (gradle wrapper 6.5). When using gradle 4.0.1 all worked well.
I'm using AndroidSigning@3 and trying to sign assembleRelease output.
@Liran-Dobrish @aleksandra-majchrzak ok, so it seems to be related to some incompatibility between gradle version and gradle plugin version specified in project and doesn't seem to be related to pipeline task - could you please check that there are compatible versions specified according to https://developer.android.com/studio/releases/gradle-plugin#updating-gradle?
In my project I'm using the pair that is listed on the link you posted: 4.1.0+ | 6.5+ (in my project it's 4.1.1 | 6.5). The same gradle wrapper version is used in the pipeline.
Zipalign is taken from build-tools version 30.0.2.
@Liran-Dobrish @aleksandra-majchrzak this issue doesn't seem to be related to zipalign task, but rather to android tools incompatibility - I would recommend to fill in a ticket on https://issuetracker.google.com/issues to get the right eyes on it
@anatolybolshakov you were right. I found this issue report https://issuetracker.google.com/issues/162117652
It seems that in the latest Gradle release the apk is built using a new library (zipflinger) which automatically alignes the apk, and zipalign fails when trying to align the apk that is already aligned (zipalign verification returns success on the initial apk)...
This sounds really strange, but apparently zipalign is not needed anymore.
Then how can i validate that the APK is aligned?
@Liran-Dobrish I believe you can run zipalign with -c flag, like this: zipalign -c -v 4 /path/to/app-release.apk
@aleksandra-majchrzak ok, thanks for reference!
@Liran-Dobrish could you please check if it works for you? We could also add this as an enhancement for zipalign task - to allow it to run in verification mode only
@anatolybolshakov i verified and the the file was aligned after "assemblyrelease".
adding a verification switch is a good idea