我按照说明为 Android 构建版本并且它是成功的。 https://flutter.io/docs/deployment/android#configure-signing-in-gradle
但是,这个项目是开源的,如果没有 keys.properties
文件,它将无法构建。这意味着贡献者无法运行该项目。
在执行 --debug
或 --profile
构建时,如何设置 build.gradle
以使用调试 key 对调试进行签名使用 --release
构建从 keys.properties
释放 key ?
最佳答案
仅当 key.properties
文件存在时才会使用释放 key
signingConfigs {
release {
if (keystorePropertiesFile.exists()) {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
}
buildTypes {
release {
if (keystorePropertiesFile.exists()) {
signingConfig signingConfigs.release
println "Signing with key.properties"
} else {
signingConfig signingConfigs.debug
println "Signing with debug keys"
}
}
}
关于android - Flutter,在 Android 上同时使用调试 key 和发布 key 进行签名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53766866/