You uploaded an APK or Android App Bundle that was signed in debug mode

9,775

Solution 1

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"
        }
    }

Solution 2

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.

Share:
9,775
Harika
Author by

Harika

Updated on December 14, 2022

Comments

  • Harika
    Harika over 1 year

    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.