Reupload the apk with a different package name after publishing the app on google play - Ionic

I have published an Ionic app to google play and it's working fine. But, I had to make a change to its package name and now when I try to reupload it, it says the package name should be the same as previous version.

Your APK needs to have the package name com.mypackagename. You need to use a different version code for your APK because you already have one with version code 'myversioncode'.

I'm happy to take down the whole app and upload the newer version but I don't think google would allow me to do it.

How can I work around this? Should I update the version code as well?

You can not update the same app with different package name instead disable the previous app and upload new app with a new package name.

Think of the packagename as kind of a unique id for you app. If you look closely, a playstore-link is always a combination of the url and your packagename, like https://play.google.com/store/apps/details?id=COM.YOUR.PACKAGENAME.

When you create a new app project in the developer console, and upload the first apk, this project is permanently linked to the given package name. I think the reason for this is androids app update scheme. By comparing the package names it checkts if you have a certain app installed, and if the installed version has a lower versioncode then the one available, it detects that you could update it.

So basically you have two options:

A) keep the old package name and do a regular update

B) change the package name and create a new app project in the developer console. publish your "new" app. Keep in mind that this app starts at zero, so your previous downloads and ratings are gone