Quick Guide On Changing Android Package Name
Occasionally you will have the need to rename your application package so here’s a quick and easy guide on how to accomplish that in just 3 steps.
First, de-compact Middle Packages
Since the middle packages(folders) are automatically compacted by Android Studio, therefore you have to de-compact them first so you can easily rename them.
- Go to the Project Explorer. Make sure it’s on Android, then click the gear icon.
- Deselect
Compact Middle Packages
. Once you have done that, you will notice the middle packages separate into individual folders.
Rename The Middle Packages
Now that the middle packages have been broken to individual folders, you can now rename any of them. Right click on the folder, select Refactor, then select Rename. Change the name and then click Refactor.
Change ApplicationId In Gradle file
Go to your app build.gradle
file, change the applicationId to the new package name and sync file. Go back to the options menu and compact the middle packages.
You have successfully changed your app package name. If there’s a much better way, I would love to hear about it. Thanks for reading!
📝 Read this story later in Journal.
👩💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. Read the Noteworthy in Tech newsletter.