First off, I acknowledge the countless posts about refactoring package name. I researched many of them and none of the answers worked for me... I'm wondering if anyone else has been having such an issue or if anyone knows how to fix this.
Here's what I've attempted, pretty much every different variant answer in all of these threads and others not included here:
Rename package in Android Studio
Refactor package name in Android Studio
How do I rename the android package name?
When I created my project I was greener grass than I am now and so just made the company name my name. Now that I'm about to launch my app I realize that having my name as package name "company" does not look as polished and professional as having my company, obviously. So I'm trying to refactor the package name as follows:
Current = firstlast.appname
Rename = com.companyname.appname
Problems I'm having: I try refactoring by actually refactoring and IntelliJ does not actually refactor everything, I change package name in the manifest as well as gradle, and still doesn't work. Then what's worse is that after cleaning up all the errors new packages pop up randomly in the project directory with the old package names, I delete these, and then more pop up. I delete these again and finally am left with the new package directories only however, I clean and rebuild and get no errors but when I try to launch I get: Class referenced in the manifest was not found in the project or the libraries, something relating to dex... I trace this down and fix these errors but get nowhere. At this point my project was so screwed up I considered deleting it and using a backup... Instead, I used history to go back in time...
I also tried creating a new package and moving all the classes and files to the newly created package and delete the old but this has its own can of worms that seems even messier than the above.
I am so lost as to why this isn't simple. Any help is much appreciated!
EDIT: Possible "go around"
I was looking at this documentation:
https://developer.android.com/studio/build/application-id.html
I used the following instruction to rename the application ID:
Changing the application ID (which is now independent of the package name) can be done very easily in one step. You don't have to touch AndroidManifest. Instead, do the following: right-click on the root folder of your project. Click "Open Module Setting". Go to the Flavours tab. Change the applicationID to whatever package name you want. Press OK.
As found here:
Rename package in Android Studio
So I'm wondering, (NEW QUESTION, ONLY PERTINENT QUESTION) if I rename the application ID as I did here and it changes in the gradle build file only, does this apply as my apps package name for submission to the app store as well as sharing the app? Or do I need to actually refactor the package completely?