So many beginners of android studio have doubt “How to change package name in android studio app“?
- You can change it easily from Android Studio. Here are the steps: You can change it easily from Android Studio.
- Here are the steps:In the Android pane, click on the little gear icon.Uncheck/Deselect the Compact Empty Middle Packages option.
- Your package directory will now be broken up in individual directories.
- Individually select each directory you want to rename, and: Right-click itSelect RefactorClick on RenameIn the Pop-up dialog.Click on Rename Package instead of Rename Directory Enter the new name and hit RefactorAllow a minute to let Android Studio update all changes.
- 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.
Note: When renaming com in Android Studio, it might give a warning. In such case, selectRename All.
It is very simple to change package name in android studio. I will show your few steps to change package name simply. Follow these steps to change package name android studio apk.
Step1
In your Project pane, click on the little gear icon
step2
Uncheck the Compact Empty Middle Packages
option

Step3
Your package directory will now be broken up into individual directories
Step4
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

Step5
Now open your Gradle Build File (build.gradle
– Usually app
or mobile
). Update the applicationId
in the defaultConfig
to your new Package Name and Sync Gradle, if it hasn’t already been updated automatically:

Step6
You may need to change the package=
attribute in your manifest
Step7
Clean and Rebuild.

Step8
Congratulations! Anyway, Android Studio needs to make this process a little simpler.
For more doubts: Click Here