I created a key and keystore and signed my apk, following the instructions step by step from the official flutter page.
But when I try to upload it to Google Play Console, I get 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 similar question is asked before, but it did not solve my issue.
Here is the relevant part of my app/build.gradle:
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "my.package.name"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
//testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Here is the screenshot of my Android Studio versions (Android SDK being red is not relevant.):
My output.json file:
[
{
"outputType": {
"type": "APK"
},
"apkInfo": {
"type": "MAIN",
"splits": [
],
"versionCode": 1,
"versionName": "1.0.0",
"enabled": true,
"outputFile": "app-release.apk",
"fullName": "release",
"baseName": "release"
},
"path": "app-release.apk",
"properties": {
}
}
]
Add app icon, splash screen, app name:: To set up an app icon you need an icon image: Make an assets folder inside your project and store the app icon inside it. Go to your pubspec. yaml file and add this code.
Upload the App's APK File to Google PlayIn your browser, go to the address , click Developer Console and log in with your Android Developer account credentials. Click the Add New Application button to begin adding your app to Google Play. Select the language and the name of your app. Press the Upload APK button.
No suggestions seemed to be working. Then, a
flutter clean
and all issues were solved. I could create an apk either through Android Studio or the command line. Thanks to VikaS and Harsha pulikollu
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