Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Play upload problem: "Your Android App Bundle needs to have the package name com.x.x.base"

I am trying to upload an application under development to Google Play Console, internal testing track. The application has two flavor dimensions and and two dynamic features, the last two being resources only (no code). I am relying on Android Studio to generate the directory structure and the signed bundle.

The name of the package is com.something.something. The upload fails with the message "Your APK or Android App Bundle needs to have the package name com.something.something.base."

I cannot track down the source of the problem, though it looks like it should have something to do with the flavor dimensions. On the other hand, I had no problem uploading a single apk, without the dynamic features.

I am not sure which part of the code is relevant here, which is probably part of my problem, but my main build gradle looks like this

apply plugin: 'com.android.application'

android {

    compileSdkVersion 27
    defaultConfig {
        applicationId 'com.something.something'
        ....
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            //testCoverageEnabled false
        }
    }

    flavorDimensions "version"
    productFlavors {
        small {
            dimension "version"
        }
        full {
            dimension "version"
        }
    }

    dynamicFeatures = [":feat1", ":feat2"]

}

dependencies {
    ...
}

I do not want to burden the question with irrelevant code, but can provide more if there is some intuition about where the problem might be.

I would be grateful for any suggestion on how to approach the debugging here. (Uploading is painfully slow, trial and error is not much of an option.)

like image 993
celaeno Avatar asked Aug 25 '19 17:08

celaeno


People also ask

How do I find my package name on Google Play?

You can find an app's package name in the URL of your app's Google Play Store listing. For example, the URL of an app page is play.google.com/store/apps/details? id=com.

How do you fix your Android App Bundle is signed with the wrong key ensure that your app bundle is signed with the correct signing key and try again?

Answers related to “Your Android App Bundle is signed with the wrong key. Ensure that your App Bundle is signed with the correct signing key and try again” first, you need to generate a signing key using keytool and create keystore file for your project.

How do I publish an app bundle on Google Play?

You can upload the App Bundle (. aab) file at the same place you used to upload your APKs in the Play Console. If this is an existing app, you will need to enroll in Play Signing first (Go to "App Releases" > "App Signing" in the Play Console) so that Google can sign the APKs it generates from the bundle.


3 Answers

Thank you all for taking a shot at the answer. Here is what I learned about this issue and how I "solved" it.

My problem starts with Google Play Console (GPC) insisting that an app name be associated with the very first package name you have uploaded. This is in addition to having one app = one package name rule. If you are still in the draft stage, you can delete the package from your "All applications" list in GPC, and upload a package with different name, but once it's published - no such luck. The way GPC is designed, all my future uploads should have the suffix ".base", if this is what my first upload had.

Next, Android Studio (AS), does something called manifest file merging. (@Fantômas, your audience may not be as omniscient as you are - the behavior of AS is relevant here, and with your permission I would return the tag.) When you choose the flavor for the bundle, the name of the flavor is suffixed to create the package name in the merged AndroidManifest file, irrespective of the name you specify in your main AndroidManifest.xml, as you can check if you choose to "analyze" (the name of the link after the bundle is generated) newly created bundle:

screenshot of android Studio with bundle contents open

Thus, in my first upload I had a flavor called base, and I did not realize that AS tacked it as the suffix on the name of my package. From that point on, GPC will not take a package for my app by any other name.

One thing that is irrelevant here are dynamic features - they just happened to be part of my second upload attempt.

I have asked Google to delete my app so I can start from scratch.

like image 92
celaeno Avatar answered Nov 08 '22 19:11

celaeno


Since your problem is not related to codes, try changing your package name to something else, something more "unique". com.myname.myappname is an example. In this case you need to change everything related to your package name. Try it and report back

like image 40
private static Avatar answered Nov 08 '22 20:11

private static


You do not need to delete your app from Google console. Simply open Build.gradle(Module:app) in your android studio and change the Application Id to the name google is requesting from you.

like image 21
IOI Avatar answered Nov 08 '22 18:11

IOI