我需要使用特定的签名配置对产品风味进行签名。我在stackoverflow上找到了一些参考,例如this和this。它适用于我的flavor发布版本,但不适用于调试版本。我在gradle中有此配置:
...
signingConfigs {
release {
storeFile file("../config/keystores/release_keystore")
storePassword "mysecurepassword"
keyAlias "myultrasecurealias"
keyPassword "myreallysecurekeypassword"
}
debug {
storeFile file("../config/keystores/debug.keystore")
storePassword "mysecurepassword"
keyAlias "myultrasecurealias"
keyPassword "myreallysecurekeypassword"
}
other {
storeFile file("../config/keystores/other")
storePassword "mysecurepassword"
keyAlias "myultrasecurealias"
keyPassword "myreallysecurekeypassword"
}
}
flavorDimensions "dim"
productflavors {
production {
dimension "dim"
}
other {
dimension "dim"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
productflavors.other.signingConfig signingConfigs.other
productflavors.production.signingConfig signingConfigs.release
}
debug {
productflavors.other.signingConfig signingConfigs.other
productflavors.production.signingConfig signingConfigs.debug
}
}
这对于otherRelease
风格来说效果很好。但是,当我使用构建配置other
时,我的APK却没有otherDebug
签名配置。
release
版本已正确签名。
有人知道为什么在调试模式下签名配置未按配置应用吗?