Member-only story
How to Rename package in Android Studio
Step by Step guide on how to rename packages in Android Studio.
2 min readSep 15, 2021
If you want to change com.example.app
to my.awesome.game
, then:
Step 1: In your Project pane, click on the little gear icon:
Step 2: Uncheck the Compact Empty Middle Packages
option
Step 3: Your package directory will now be broken up into individual directories
Step 4: Individually select each directory you want to rename, and:
- Right-click it
- Select
Refactor
- Click on
Rename
- In the pop-up dialog, click on
Rename Package
instead of Rename Directory - Enter the new name and hit Refactor
- Click Do Refactor in the bottom
- Allow a minute to let Android Studio update all changes
- Note: When renaming
com
in Android Studio, it might give a warning. In such case, select Rename All