Unable to zipalign apk android android studio 2.2
Asked Answered
T

3

7

I am publishing my app using android studio 2.2 preview 3 and generating signed apk. But when i am uploading apk to google play i am getting error

You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK and upload it again.    

Also i tried to used zipalign tool manually but i am getting error verification failed.
Here is my build.gradle file

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
    applicationId "blackdogs.newaomsi"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        zipAlignEnabled true
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'


    }
}}
Thyrsus answered 15/6, 2016 at 16:12 Comment(4)
What's the oputput of zipalign -c -v 4 yourapk.apk?Overbuild
@Overbuild 5379164 resources.arsc (OK) Verification FAILEDThyrsus
Then your apk is not zipaligned. Could you try executing zipalign -f -v 4 yourapk.apk yourzipalignedapk.apk and then zipalign -c -v 4 yourzipalignedapk.apk?Overbuild
@Overbuild Tried as u said still getting the same errorThyrsus
T
6

Got it. Error was due to gradle version i was using. Downgraded gradle version to

 'com.android.tools.build:gradle:2.1.2'
Thyrsus answered 15/6, 2016 at 17:52 Comment(0)
L
4

This is a known issue with Android Studio 2.2 Preview 3, as explained in this blog post and this issue.

You have to download Preview 2 or use the stable version of Android Studio.

Longhand answered 15/6, 2016 at 16:47 Comment(1)
finally ended up installing 2.1 in parallelTemplar
H
1

solved in the next release

classpath 'com.android.tools.build:gradle:2.2.0-alpha4'

reference link:https://code.google.com/p/android/issues/detail?id=212591

Homager answered 2/7, 2016 at 0:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.