小编gar*_*rik的帖子

如果选择签名 v2,则生成的 APK 不会被签名

我正在尝试为我的应用程序生成一个签名的 APK,如果我只使用签名 V1,它就可以工作。当我使用签名V2然后用keytool检查apk时,输出是:

keytool -list -printcert -jarfile app-release.apk
Not a signed jar file
Run Code Online (Sandbox Code Playgroud)

这是 build.gradle:

def getProps(path) {
    Properties props = new Properties()
    props.load(project.rootProject.file(path).newDataInputStream())
    return props
}

android {
    ...
    signingConfigs {
        debug {
            try {
                Properties props = getProps('./local.properties')
                storeFile file(props.getProperty('DEBUG_STORE_FILE', ''))
                keyAlias props.getProperty('DEBUG_KEY_ALIAS', '')
                keyPassword props.getProperty('DEBUG_STORE_PASSWORD', '')
                storePassword props.getProperty('DEBUG_STORE_PASSWORD', '')
                v1SigningEnabled true
                v2SigningEnabled false // enabling this generates unsigned apk
            }
            catch (ex) {
                throw new InvalidUserDataException("You should define RELEASE_STORE_FILE, RELEASE_KEY_ALIAS, RELEASE_STORE_PASSWORD in local.properties.")
            }
        }
        release { …
Run Code Online (Sandbox Code Playgroud)

android signed-apk

6
推荐指数
1
解决办法
3612
查看次数

标签 统计

android ×1

signed-apk ×1