“Your APK or Android App Bundle needs to have the package name…”: how to fix it
Why Google Play rejects an update with this error, the four usual causes, and where to set the package name back in Android Studio, Flutter, React Native, Expo and Unity.
You upload a new build to the Play Console and it is rejected with: “Your APK or Android App Bundle needs to have the package name com.example.app.” Some versions word it as “The package name of your APK or Android App Bundle must be …”. Both mean the same thing: you are uploading to an app that already exists, and your build’s package name doesn’t match the one that app was created with.
Why it happens
Every app in the Play Console is tied for good to the package name of its first upload. Every later build, on every track, has to use the same one. The usual ways it changes without you meaning to:
- You uploaded the wrong build variant. A debug or staging build often adds a suffix through applicationIdSuffix or a product flavor, so com.example.app becomes com.example.app.debug.
- You renamed the namespace. If applicationId isn’t set explicitly, Gradle falls back to the namespace, so renaming your code package silently renames the app.
- A tool regenerated the Android project. Recreating a Flutter, React Native or Capacitor project, or running Expo prebuild with a different android.package, writes a new applicationId.
- You picked the wrong app in the Play Console. With several apps in one account, it’s easy to open the wrong one and upload there.
The fix
- Copy the exact package name from the error. That is the one the Play Console expects.
- Set it as applicationId for your release build (see the table below).
- Check build.gradle for applicationIdSuffix or product flavors that change the ID, and make sure you build the release variant.
- Rebuild the release bundle and upload it. It must also be signed with the same upload key as before; a key mismatch gives a different error.
| Project type | Where the package name is set |
|---|---|
| Android Studio (Kotlin/Java) | applicationId in app/build.gradle or app/build.gradle.kts |
| Flutter | applicationId in android/app/build.gradle (or build.gradle.kts) |
| React Native (bare) | applicationId in android/app/build.gradle |
| Expo | android.package in app.json or app.config.js, then rebuild |
| Unity | Player Settings → Other Settings → Identification → Package Name |
If you really wanted a new package name
You can’t change the package name of an existing app. A new package name means creating a new app in the Play Console, which starts from zero installs, ratings and reviews. If you’re rebranding, here is how to rename an app without losing reviews: you keep the package name and change only the store name.
If you are starting a new listing anyway, pick a package name that nobody else holds. Google Play never reuses one, even from deleted apps (more on that error).
Questions people ask
Can I change the package name of an app that’s already on Google Play?
No. It stays the same for the life of the listing. A different package name is a different app.
Does it apply to internal testing too?
Yes. All tracks (internal, closed, open and production) belong to the same app, so every build must use its package name.
Does the package name have to match my code package?
No. Google Play only looks at applicationId. The code namespace can be anything.
What if the error says my app is signed with the wrong key?
That’s a separate problem: the package name is right but the upload key isn’t. Sign with your original upload key, or ask Google Play support to reset it if you lost it.
Sources
Check your own name
Domains, both app stores, bundle IDs and every live site using the name, in under a minute.
Check a name