I noticed that when downgrading the plugin and running gradlew from the
command line:
With the new plugin (version 2.2.0) upon './gradlew assembleDebug' I get:
:
:app:validateSigningDebug
:app:packageDebug
:app:assembleDebug
:
but with the old one (2.1.2) I get:
:
:app:validateDebugSigning
:app:packageDebug
:app:zipalignDebug
:app:assembleDebug
:
Notice that the zipAlign step is missing in the old plugin. Not sure if
this is the issue, but I wonder if that has something to do with the
"zipalign twice works" solution as well.
Also, in both cases my build.gradle says:
buildTypes {
:
zipAlignEnabled true
:
}
On Tuesday, August 2, 2016 at 4:49:11 AM UTC-7, [email protected] wrote:
>
> With Android Studio 2.2 Preview 6 I got working apk which can be directly
> uploaded to Play store.
> And maybe non-related, but hint - check : Module settings -> app -> Build
> Types -> release -> "Zip Align Enabled" should have value "true"
>
> Urmas
>
> On Thursday, June 9, 2016 at 7:15:15 PM UTC+3, Fabs wrote:
>>
>> Hello all.
>>
>> I have never encountered this issue before, despite developing several
>> apps. When I build a signed production APK using Android Studio, I get an
>> app-release.apk file but it is rejected by Google Play, saying it needs to
>> be zipaligned. When I verify the alignment using zipalign tool, I receive
>> output like this:
>>
>> 1876394 res/layout/design_bottom_sheet_dialog.xml (OK - compressed)
>> 1876935 res/layout/design_layout_snackbar.xml (OK - compressed)
>> 1877313 res/layout/design_layout_snackbar_include.xml (OK - compressed)
>> 1877936 res/layout/design_layout_tab_icon.xml (OK - compressed)
>> 1878215 res/layout/design_layout_tab_text.xml (OK - compressed)
>> 1878540 res/layout/design_menu_item_action_area.xml (OK - compressed)
>> 1878804 res/layout/design_navigation_item.xml (OK - compressed)
>> 1879186 res/layout/design_navigation_item_header.xml (OK - compressed)
>> 1879517 res/layout/design_navigation_item_separator.xml (OK - compressed)
>> 1879844 res/layout/design_navigation_item_subheader.xml (OK - compressed)
>> 1880231 res/layout/design_navigation_menu.xml (OK - compressed)
>> 1880609 res/layout/design_navigation_menu_item.xml (OK - compressed)
>> 1881116 res/layout/notification_media_action.xml (OK - compressed)
>> 1881527 res/layout/notification_media_cancel_action.xml (OK - compressed)
>> 1882005 res/layout/notification_template_big_media.xml (OK - compressed)
>> 1882747 res/layout/notification_template_big_media_narrow.xml (OK -
>> compressed)
>> 1883472 res/layout/notification_template_lines.xml (OK - compressed)
>> 1884347 res/layout/notification_template_media.xml (OK - compressed)
>> 1884968 res/layout/notification_template_part_chronometer.xml (OK -
>> compressed)
>> 1885372 res/layout/notification_template_part_time.xml (OK - compressed)
>> 1885772 res/layout/select_dialog_item_material.xml (OK - compressed)
>> 1886199 res/layout/select_dialog_multichoice_material.xml (OK -
>> compressed)
>> 1886700 res/layout/select_dialog_singlechoice_material.xml (OK -
>> compressed)
>> 1887202 res/layout/support_simple_spinner_dropdown_item.xml (OK -
>> compressed)
>> 1887559 res/menu/menu_login.xml (OK - compressed)
>> 1887906 res/mipmap-hdpi-v4/ic_launcher.png (BAD - 2)
>> 1891092 res/mipmap-mdpi-v4/ic_launcher.png (OK)
>> 1893113 res/mipmap-xhdpi-v4/ic_launcher.png (BAD - 1)
>> 1897545 res/mipmap-xxhdpi-v4/ic_launcher.png (BAD - 1)
>> 1904619 res/mipmap-xxxhdpi-v4/ic_launcher.png (BAD - 3)
>> 1914156 resources.arsc (OK)
>> Verification FAILED
>>
>> Indeed it is not aligned. But when I try to re-align it, I get this:
>>
>> 1881710 res/layout/notification_media_action.xml (OK - compressed)
>> 1882121 res/layout/notification_media_cancel_action.xml (OK - compressed)
>> 1882599 res/layout/notification_template_big_media.xml (OK - compressed)
>> 1883341 res/layout/notification_template_big_media_narrow.xml (OK -
>> compressed)
>> 1884066 res/layout/notification_template_lines.xml (OK - compressed)
>> 1884941 res/layout/notification_template_media.xml (OK - compressed)
>> 1885562 res/layout/notification_template_part_chronometer.xml (OK -
>> compressed)
>> 1885966 res/layout/notification_template_part_time.xml (OK - compressed)
>> 1886366 res/layout/select_dialog_item_material.xml (OK - compressed)
>> 1886793 res/layout/select_dialog_multichoice_material.xml (OK -
>> compressed)
>> 1887294 res/layout/select_dialog_singlechoice_material.xml (OK -
>> compressed)
>> 1887796 res/layout/support_simple_spinner_dropdown_item.xml (OK -
>> compressed)
>> 1888153 res/menu/menu_login.xml (OK - compressed)
>> 1888500 res/mipmap-hdpi-v4/ic_launcher.png (OK)
>> 1891688 res/mipmap-mdpi-v4/ic_launcher.png (OK)
>> 1893712 res/mipmap-xhdpi-v4/ic_launcher.png (OK)
>> 1898144 res/mipmap-xxhdpi-v4/ic_launcher.png (OK)
>> 1905220 res/mipmap-xxxhdpi-v4/ic_launcher.png (OK)
>> 1914757 resources.arsc (BAD - 1)
>> Verification FAILED
>>
>> Ultimately, it appears that my APK cannot be aligned by zipalign? I am
>> using these options: -f -v 4 to align and -c -v 4 to verify.
>>
>> Is this a known issue with zipalign, or have I made some kind of insane
>> error? Cheers.
>>
>
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/fdcd5411-c5f3-48d6-8f0a-1935b02b872c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.