Rename package Android Studio

Here step rename package project In Android Studio, in example

from :
to :

Make sure there’s no app use same package by checking here[your new package] like this :

If your purpose renaming package is for google play upload, on Android Studio you only need to change applicationId at app/build.gradle


Then you no need to do instruction below because some case face error,

  1. Create new package in java directory, e.g. Right click on app/src/main/java directory -> New -> Package.
  2. Select all packages and classes in and move (drag) them to the new package. Confirm by click on Do Refactor.
  3. Delete the old package
  4. Open app/src/main/AndroidManifest.xml and rename the package name. Select package name -> Right click on selected text -> Refactor -> Rename -> enter the new package name (,  select “Search in comments and strings” option -> Refactor -> Do Refactor.
  5. Clean the project. Main menu -> Build -> Clean Project.
  6. Replace all occurrences of for a new package name, e.g. Right click on app directory -> Replace in Path -> set old and new package names, Case sensitive to true -> Find -> Replace.
  7. Clean the project again. Main menu -> Build -> Clean Project.
  8. Synchronize the project. Main menu -> Tools -> Android -> Sync Project with Gradle Files.
  9. If you appear Activity class does not exist error restart Android Studio.

Thanks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *