Change the Package Name

You can change it easily from Android Studio. Here are the steps:

1. In the Project pane, click on the little gear icon. Uncheck/Deselect the Compact Empty Middle Packages option.

2. Your package directory will now be broken up into individual directories.

3. Individually select each directory you want to rename, and: Right-click it Selects RefactorClick on Rename in the Pop-up dialog.

4. Click on Rename Package instead of Rename Directory

5. Enter the new name, select both check boxes and select "All Places" in scope then hit Refactor, and allow a minute to let Android Studio update all changes.

After Click on Do Refactor

6. Now open your build.gradle (Usually 'app' or 'mobile'). Update the applicationId to your Package Name and Sync Gradle, if it hasn't already been updated automatically.

7. Also Change In AndroidManifest.xml

Note: When renaming com in Android Studio, it might give a warning. In such case, select Rename All.


For Confirmation If any error in the Package changing check in the below files, and change the type with your package name, you can see the below screen.
  • AndroidManifest.xml (app->manifest)
  • activity_about_us.xml (res->layout)
  • activity_profile.xml (res->layout)
  • item_business.xml (res->layout)
  • item_category.xml (res->layout)
  • item_custom_category.xml (res->layout)
  • item_custom_model_category.xml (res->layout)
  • item_festival.xml (res->layout)
  • item_frame.xml (res->layout)
  • item_home_festival.xml (res->layout)
  • item_language.xml (res->layout)
  • item_news.xml (res->layout)
  • item_post.xml (res->layout)
  • item_story.xml (res->layout)
  • item_subs_plan.xml (res->layout)


Was this article helpful?