I'm trying to upload my AAB file to Google Play Store, i follow this https://facebook.github.io/react-native/docs/signed-apk-android for generating .aab file, but i'm getting this error You uploaded an APK or Android App Bundle that was signed in debug mode. You need to sign your APK or Android App Bundle in release mode.
A debug version of your app is meant to be optimized for that- even if that means adding extra logs (from the system or from your app), systems to catch errors, data tracking and management, everything you can access from the debug menu, and much more.
To start debugging an APK, click Profile or debug APK from the Android Studio Welcome screen. Or, if you already have a project open, click File > Profile or Debug APK from the menu bar. In the next dialog window, select the APK you want to import into Android Studio and click OK.
The package name is the identitiy of the application. To rename the package name, In eclipse right click on the project in project explorer. Then Android Tools > rename Aplication Package name. Then enter the new package name.
In android/app/build.gradle
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
change to
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
This is an issue for Flutter as well as React Native. To state it more briefly, the release block of buildTypes in android/app/build.gradle needs to include signingConfigs.release
, not signingConfigs.debug
.
buildTypes {
release {
signingConfig signingConfigs.release
}
}
This is shown in the Flutter documentation, but it isn't clearly stated. I've seen two people miss it in the last day.
minifyEnabled
and proguardFiles
are not required unless you need those options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With