【发布时间】:2016-10-16 21:02:39
【问题描述】:
我正在使用 android studio 2.2 preview 3 发布我的应用程序并生成签名的 apk。但是当我将 apk 上传到 google play 时出现错误
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.
我也尝试手动使用 zipalign 工具,但我收到错误验证失败。
这是我的 build.gradle 文件
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'
}
}}
【问题讨论】:
-
zipalign -c -v 4 yourapk.apk的输出是多少? -
@antonio 5379164 resources.arsc (OK) 验证失败
-
那么你的 apk 不是 zipaligned。你可以尝试执行
zipalign -f -v 4 yourapk.apk yourzipalignedapk.apk然后zipalign -c -v 4 yourzipalignedapk.apk吗? -
@antonio 像你说的那样尝试过,仍然出现同样的错误
标签: android google-play apk zipalign