[英]You have sent a signed APK or Android App Bundle in debug mode. Sign it in release mode. How to fix it (flutter)
I have to generate an APK to publish the app in Google Play Store, so I did this steps:我必须生成一个 APK 才能在 Google Play 商店中发布应用程序,所以我执行了以下步骤:
keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
and paste the file key.jks inside android/appkeytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
并将文件 key.jks 粘贴到 android/appkey.properties
with this content:key.properties
的文件,其中包含以下内容:storePassword=myPass
keyPassword=myPass
keyAlias=KEY
storeFile=/app/key.jks
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now,
// so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
Run flutter clean
运行
flutter clean
Run flutter build apk --split-per-abi --release
:运行
flutter build apk --split-per-abi --release
:
But when I send the apks to google play publish I receive this message:但是,当我将 apk 发送到 google play publish 时,我会收到以下消息:
You have sent a signed APK or Android App Bundle in debug mode.
您已在调试模式下发送了签名的 APK 或 Android App Bundle。 Sign it in release mode
在发布模式下签名
What I need to do?我需要做什么?
Remove the duplicate buildType release
删除重复的
buildType release
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now,
// so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
Or rename to debug
.或重命名为
debug
。
buildTypes {
release {
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.debug
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.