Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 870
Harika Avatar asked Sep 18 '19 10:09

Harika


People also ask

What is a debug APK?

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.

How do I open a debug app APK?

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.

How do you fix you need to use a different package name because COM example is restricted?

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.


2 Answers

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"
        }
    }
like image 118
Muhammad Iqbal Avatar answered Oct 17 '22 18:10

Muhammad Iqbal


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.

like image 24
Suragch Avatar answered Oct 17 '22 18:10

Suragch