Android Studio 2.2 - 无法再创建未签名的发布版本 - "validateSigningReleaseLive FAILED"
Android Studio 2.2 - Can no longer create unsigned release builds - "validateSigningReleaseLive FAILED"
升级到 Android Studio 2.2 后,我无法再创建未签名的发布版本。调试版本创建良好。 Android Studio 2.1 上没有发生此问题。我想不通。应用程序 gradle 文件有这个:
defaultConfig {
applicationId "com.company.myapp"
versionCode 66
versionName "1.0"
signingConfig signingConfigs.noSigning
minSdkVersion 15
targetSdkVersion 23
multiDexEnabled true
}
buildTypes {
debug {
}
release {
minifyEnabled true // Set to true to enable proguard
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
signingConfig signingConfigs.noSigning
zipAlignEnabled false
}
releaseLive.initWith(buildTypes.release);
releaseLive {
signingConfig signingConfigs.noSigning
}
}
这是当 gradle 任务“assembleRelease
”或“assembleReleaseLive
”为 运行 时发生的情况,然后我按下 "text mode" 按钮'Run' window 获取文本输出:
Executing external task 'assembleReleaseLive'...
:app:preBuild UP-TO-DATE
...
[All tasks run successfully up to until this]
...
:app:lintVitalReleaseLive
:app:validateSigningReleaseLive FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:validateSigningReleaseLive'.
> Keystore file not set for signing config noSigning
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
有人知道怎么解决吗?如果我删除 "signingConfig"
行,它不会修复它。
我最终弄明白了:删除所有 3 行“signingConfig signingConfigs.noSigning
”,其中“noSigning
”定义为:
signingConfigs {
noSigning {
keyAlias ''
keyPassword ''
storePassword ''
storeFile null
}
defaultSigning {
storeFile file('signing/signing.keystore')
storePassword 'password'
keyAlias 'alias'
keyPassword 'password'
}
}
那些“noSigning
”行似乎在 Android Studio 2.2 上不起作用。我想它们无论如何都是非标准的,因为 'assembleRelease' 任务无论如何都会默认创建一个未签名的构建。
升级到 Android Studio 2.2 后,我无法再创建未签名的发布版本。调试版本创建良好。 Android Studio 2.1 上没有发生此问题。我想不通。应用程序 gradle 文件有这个:
defaultConfig {
applicationId "com.company.myapp"
versionCode 66
versionName "1.0"
signingConfig signingConfigs.noSigning
minSdkVersion 15
targetSdkVersion 23
multiDexEnabled true
}
buildTypes {
debug {
}
release {
minifyEnabled true // Set to true to enable proguard
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
signingConfig signingConfigs.noSigning
zipAlignEnabled false
}
releaseLive.initWith(buildTypes.release);
releaseLive {
signingConfig signingConfigs.noSigning
}
}
这是当 gradle 任务“assembleRelease
”或“assembleReleaseLive
”为 运行 时发生的情况,然后我按下 "text mode" 按钮'Run' window 获取文本输出:
Executing external task 'assembleReleaseLive'...
:app:preBuild UP-TO-DATE
...
[All tasks run successfully up to until this]
...
:app:lintVitalReleaseLive
:app:validateSigningReleaseLive FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:validateSigningReleaseLive'.
> Keystore file not set for signing config noSigning
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
有人知道怎么解决吗?如果我删除 "signingConfig"
行,它不会修复它。
我最终弄明白了:删除所有 3 行“signingConfig signingConfigs.noSigning
”,其中“noSigning
”定义为:
signingConfigs {
noSigning {
keyAlias ''
keyPassword ''
storePassword ''
storeFile null
}
defaultSigning {
storeFile file('signing/signing.keystore')
storePassword 'password'
keyAlias 'alias'
keyPassword 'password'
}
}
那些“noSigning
”行似乎在 Android Studio 2.2 上不起作用。我想它们无论如何都是非标准的,因为 'assembleRelease' 任务无论如何都会默认创建一个未签名的构建。