How To Change Package Name In Android Studio

How To Change Package Name In Android Studio

Want to change the package name of your existing app or any android projects that you brought/downloaded recently? but getting errors? renaming folder or manifest or gradle will bring errors and thus you won’t be able to compile it. So, it’s really important to follow the correct steps to rename the package name of your android app.

Generally, a package is a directory where the source codes are stored. As an example: com.company.app . A developer may change the package name for different reasons such as he download or purchased a project source code from the web and need to rename it according to his app’s details.

So, if you are trying to change your old package name to a new name like: com.company.app to com.zealtyro.app or something, then this article is for you! Let’s jump inside…

Changing/Renaming The Package Name In Android Studio

First of all, open your project in android studio. Then follow the steps below:

  1. Click on the settings icon on the top right corner in “project” tab
    How To Change Package Name In Android Studio
  2. Uncheck the “compact middle packages
    How To Change Package Name In Android Studio
  3. Now you will see that the folder named with the package name has divided into 3 folders.
    How To Change Package Name In Android Studio
  4. Select the folder named with what you want to change and right click on it. Then go to “Refactor“, then click on “Rename“.
    How To Change Package Name In Android Studio
  5. A popup dialogue will appear, click “Rename Package
    How To Change Package Name In Android Studio
  6. In the input box type the name you prefer to have and click “refactor
    How To Change Package Name In Android Studio
  7. If your android project have so many activities then it may take few minutes and an extra dialogue may appear on the bottom. just click “refactor” button if it appears.
  8. Now you will see the folder name got change. If not then don’t worry, just close the project and reopen it.
    How To Change Package Name In Android Studio
  9. Now we need to open the “build.gradle (Module)“, you can find it in the “Gradle Scripts” section. Then change the “application id” to the new package name if it not got updated yet. Then click “Sync Now“.
    How To Change Package Name In Android Studio
  10. Next, open the “AndroidManifest.xml” and change the package name to the new one if it’s not got updated yet.
    How To Change Package Name In Android Studio
  11. Done!

Congratulations!

You have successfully change the package name of your android app in android studio!

Thanks For Allowing Us To Help You 🙂
If you are confused or want to know something, then let us know in the comment box, we will reach you as soon as possible. Don’t Forget To Subscribe our Newsletter, YouTube Channel, and Like Our Facebook Page To Keep Updated With Awesome Things. Follow us on Twitter to stay updated with the latest news & changes.

Mahedi Zaber
Android Developer | Owner Of ZealTyro I love to make friends and get connected with people. Isn't it feels too good to help others?
Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Ads are the only way for us to keep this site up and running. We don\\\\\\\'t show any malicious or annoying ads.

So, help us by disabling your adblocker on our site :(