android - 无法压缩 apk android android studio 2.2

标签 android google-play apk zipalign

我正在使用 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'


    }
}}

最佳答案

明白了。错误是由于我使用的 gradle 版本。 将 gradle 版本降级为

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

关于android - 无法压缩 apk android android studio 2.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37840657/

相关文章:

android - 在android studio中制作带有大写包名的apk

android - 在以编程方式安装android中的应用程序后如何检测用户是否单击完成或打开

Android 使用 JTransform 库可视化 PCM 数据

android - 应用程序在重新安装后使用 GCM 收到重复通知

Android Espresso - 单击带有图像和文本的抽屉导航项目

android - Google play 测试购买

gmail - 适用于Android Market LVL测试的Gmail测试帐户?

android - ProGuard 不生成映射文件

android - Cordova APK 首次运行时不请求权限

android - 关于编辑文本框焦点变化的问题(看到其他问题..他们确实帮助)