How to solve the failed verification with zipalign

2019-03-29 07:02发布

问题:

I have a problem with zipalign. I can't go through the proces. Each run ends with Verification FAILED. For some files i see something like this

2574474 res/drawable-xxxhdpi-v4/abc_btn_radio_to_on_mtrl_000.png (BAD - 2)

for the reset

7044070 res/layout/notification_template_media.xml (OK - compressed)

The apk is generated but when I upload it via console I receive info that it is not compressed properly. What can I do ?

回答1:

Seems like gradle has pushed a new version without the zipalign task. I had the same issue after changing this:

classpath 'com.android.tools.build:gradle:2.+'

to

classpath 'com.android.tools.build:gradle:2.1.2'

The problem was solved for me.



回答2:

Chen is right. When you upgrade your AS, you need to check your build.grade.

buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }

check that gradle version is 2.1.2 or not. I try 2.2.0-alpha3, and always get zipalign fialed. Just downgrade grade version to 2.1.2 Then solve this problem.

Try it.