How to rename package name in Android Studio

Rename package name in android studio, This article we will discuss two ways to rename package name. We can rename package name through project panel and manifest file. Both methods are discussed below.

We shall start with how to rename using project panel and finalize by using manifest file.

If you would like to learn from video tutorial, here is the link

https://youtu.be/nMj1znFVM00

Using project panel to rename package name

Using project panel to rename package name

Steps by steps of renaming using package name

  • Click on the gear icon on your project panel
  • Uncheck Compact middle packages on the menu option that appear
  • Once your project package name will be broken down to individual directories
  • Right click directory you want to rename.
  • Select refactor -> Rename
  • A warning popup will appear select rename package
  • Provide the new package name and refactor
Refactor and Rename package name
  • To see the name package name, select the gear icon again and check compact middle package.
  • To finish open your gradle build and update applicationId under defaultConfig .
Update package name in your gradle build
  • Clean and reproject.
Clean and Build your project

That’s all, how to rename your package name using project panel.

Rename package name using manifest file

  • Open your android studio manifest file
  • right click on your
Rename package name using manifest file
  • A warning popup will appear select rename package
rename package name screen shoot
  • To see the name package name, select the gear icon again and check compact middle package.
  • To finish open your gradle build and update applicationId under defaultConfig .
update package name in build gradle
  • Clean and reproject.
clean and build android studio

All done, How to rename package name using manifest file.

In this article we have only discussed the two main way of renaming package name, Note there are other way which will be discussed later.

if you have a question feel free to comment below.
For more information kindly check android developer page: https://developer.android.com/studio/build/application-id