Trouble changing package_name in Ionic 5

I’m trying to submit my app built with Ionic 5 / capacitor, and the Play Store keeps rejecting the bundle:

In Android Studio I’ve opened AndroidManiest.xml and changed that first line:


And I’ve opened strings.xml:

But somehow when I build the bundle it’s retaining the package name “io.ionic.starter”.

I’m building in Android Studio by clicking Build -> Generate Signed Bundle / APK -> Android App Bundle --> Release.

Do I need to change the package name anywhere else?

Do I need to do anything after changing the package name?

“appId” in capacitor.config.json.

Strange, it’s already changed there.

Then blow away all build directories and rebuild the app from scratch.

Sorry I’m new to Ionic. Any hints on which directories to delete, or to keep? I’m worried about deleting something I shouldn’t.

I’m only building for Android, should I just delete the /Android directory? Or should I do a build remove android?


I would nuke www, rebuild, and then npx cap sync.

Wow, still getting the issue. Here’s what I did:

  • closed Android Studio

  • deleted www directory

  • ran “ionic capacitor build android --prod”. That regenerated the www directory.

  • run “npx cap sync”

Then in Android Studio I run Build -> Generate Signed Bundle or APK -> Android App Bundle -> Release. That builds app-release.aab.

And then I upload it to the Play Store and get the error cited in first post about “io.ionic.starter” already existing in the app store.

In Android Studio I open AndroidManifest.xml and there’s no mention of that ID. Same with strings.xml. And opening capacitor.config.json doesn’t have it either.

Any idea what I’m doing wrong?

Wow, I think I found it. Only took 3 hours. In Android Studio, under Gradle Scripts, find file “build.gradle (Module:app)” and change applicationId there.