Reputation:
I have to generate an APK to publish the app in Google Play Store, so I did this steps:
keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
and paste the file key.jks inside android/appkey.properties
with this content: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
Run flutter build apk --split-per-abi --release
:
But when I send the apks to google play publish I receive this message:
You have sent a signed APK or Android App Bundle in debug mode. Sign it in release mode
What I need to do?
Upvotes: 1
Views: 2892
Reputation: 1654
Remove the duplicate 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
.
buildTypes {
release {
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.debug
}
}
Upvotes: 3