將APK上傳到Google Play時遇到了我以前從未遇到的錯誤。該窗口告訴我,我正在上傳未對齊的APK。但是,當我上傳了以前版本的APK時,這些錯誤從未發生過。android APK上傳到Google Play時不對齊
我已經嘗試過通過終端手動對齊APK,並且在build.gradle
文件中爲zipAlignEnabled true
對齊移動和磨損。我會後下面
全gradle這個文件還我最近發現,Android的工作室生成兩個簽署apk的,當我點擊生成APK簽署(一個名爲移動release.apk和一個名爲磨損release.apk)以前從未這樣做過。這可能是爲什麼?
任何幫助?
的build.gradle(模塊:手機)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24-rc4"
defaultConfig {
applicationId "com.vivekvinodh.example"
minSdkVersion 21
targetSdkVersion 23
versionCode 11
versionName "0.7"
// Enabling multidex support.
multiDexEnabled true
}
signingConfigs {
release {
storeFile file('***********')
storePassword "************"
keyAlias "******"
keyPassword "************"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
zipAlignEnabled true
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
wearApp project(':wear')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.google.android.gms:play-services-ads:9.0.2'
compile 'net.steamcrafted:materialiconlib:1.0.9''
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v4:23.4.0'
...
}
的build.gradle(模塊:磨損)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24-rc4"
defaultConfig {
applicationId "com.vivekvinodh.example"
minSdkVersion 21
targetSdkVersion 23
versionCode 11
versionName "0.7"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.4.0'
compile 'com.google.android.gms:play-services-wearable:9.0.2'
compile 'com.android.support:palette-v7:23.4.0'
compile 'com.ustwo.android:clockwise-wearable:1.0.1'
...
}
在您的'build.gradle'文件中'minifyEnabled false'將其更改爲'minifyEnabled true' – Shashanth
這也可以幫助您[見此](http://stackoverflow.com/a/38055015/1978475) – Vrajesh