简体   繁体   English

在Android Studio 2.1.1中生成未签名的APK

[英]Generating unsigned apk in Android Studio 2.1.1

I'm trying to generate unsigned apk in AS 2.1.1. 我正在尝试在AS 2.1.1中生成未签名的APK。 I had it working on 1.5.1 but right now I can't get it right. 我已经在1.5.1上工作了,但是现在我做对了。

Approaches tried: 尝试的方法:

signingConfigs {

    unsigned {
        keyAlias ''
        keyPassword ''
        storePassword ''
    }
    ...
}

buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.unsigned
            debuggable false
        } 
        ...
}

Also another approach with not specifiying the signingConfig at all. 另一种完全不指定signingConfig的方法。 None of these work and both return with error. 这些都不起作用,并且都返回错误。

Error:Execution failed for task ':app:validateUnsignedSigning'. 错误:任务':app:validateUnsignedSigning'的执行失败。 Keystore file not set for signing config unsigned 密钥库文件未设置为未签名配置

Generation is done by starting "assemble" task on whole project. 通过在整个项目上启动“汇编”任务来完成生成。 Executing assemble task from the main module tasks tree produces the same result. 从主模块任务树执行汇编任务会产生相同的结果。

Build tools: buildToolsVersion '23.0.1' Gradle: 'com.android.tools.build:gradle:2.0.0' 编译工具:buildToolsVersion '23 .0.1'Gradle:'com.android.tools.build:gradle:2.0.0'

What am I missing? 我想念什么?

To create unsigned apk set null as signingConfig: 要创建未签名的apk,请将null设置为signingConfig:

buildTypes {
    release {
        signingConfig null
        ...
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM