1746

How do you rename packages in the new IDE Android Studio, based on IntelliJ IDEA?

Is there an automatic refactoring included?

I want to make bulk refactoring, but I don't know how. I worked two years with Eclipse and in Eclipse it's a one-click operation.

4
  • Please see my answer here. I have successfully managed to rename my project using the steps I have described.
    – Leigh
    Dec 1, 2014 at 16:12
  • possible duplicate of Change project name on Android Studio
    – Leigh
    Dec 2, 2014 at 10:28
  • Step by Step Process for Changing Package name... stackoverflow.com/a/46945668/6915572 Oct 26, 2017 at 4:16
  • The answer by Sheharyar works as expected. i.e 1. Refactor 2. Edit build.gradle. However, you will have to follow it up by changing the app_name attribute in strings.xml file too!
    – user8066636
    Dec 24, 2018 at 9:32

56 Answers 56

3525

In Android Studio, you can do this:

For example, if you want to change com.example.app to my.awesome.game, then:

  1. In your Project panel, click on the little gear icon ( Gears icon )

  2. Uncheck the Compact Empty Middle Packages option

    Compact Empty Middle Packages

  3. Your package directory will now be broken down into individual directories

  4. Individually select each directory you want to rename, and:

  • Right-click on 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

    Enter image description here

  1. 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:

    Refactor Directories

  2. You may need to change the package= attribute in your manifest.

  3. Clean and Rebuild.

    Clean and Rebuild

  4. Done! Anyway, Android Studio needs to make this process a little simpler.

72
  • 30
    WARNING: if you select "Rename all" when renaming also "com" it will rename not only things into the selected module but into all modules into this project Apr 17, 2015 at 8:29
  • 12
    What should I do if I need to delete part of the package? I mean, from com.example.test to com.example
    – Antonio
    Jul 28, 2015 at 16:21
  • 24
    @Antonio drag the files in com.example.test to com.example and then delete com.example.test.
    – Dick Lucas
    Jul 28, 2015 at 17:13
  • 29
    This procedure worked for me. I had to also change the AndroidManifest.xml to reflect the new name. For example -> package="my.awesome.game" >
    – nevzo
    Jul 31, 2015 at 23:26
  • 40
    If you are using firebase, change your package_name in google-services.json as well.
    – Samar Ali
    Feb 13, 2017 at 8:38
640

Another good method is: First create a new package with the desired name by right clicking on the Java folder → NewPackage.

Then, select and drag all your classes to the new package. Android Studio will refactor the package name everywhere.

Finally, delete the old package.

Done.

Very important:

You have to manually change AndroidManifest.xml and build.gradle file to the new package if you use this method.

21
  • 71
    You may need to update your Android Manifest file to reference the new package if you use this method. Very simple step though, great solution.
    – Dick Lucas
    Apr 4, 2014 at 2:38
  • 12
    You might have to restart Android studio to update the .idea/workspace.xml
    – Christoph
    Apr 17, 2014 at 1:09
  • 25
    You also may need to change your build.gradle to reflect the new package Aug 2, 2014 at 13:59
  • 40
    good method but had to do 2 more things(other than updating manifest file) to make it completely work, firstly had to change/rename the R file imports in whole project and secondly appdebug was using old package name( visible in run window of studio) added applicationId "com.packagename" in app build.gradle defaultconfig ..
    – baboo
    Sep 11, 2014 at 10:39
  • 2
    @baboo To make that first part easier, you can optimize file imports for the whole project by pressing Ctrl+Alt+O and selecting all files, then clicking run. This is especially useful if you have many activities and other classes with R file imports. Jan 24, 2015 at 15:37
244

Changing the application ID (which is now independent of the package name) can be done very easily in one step. You don't have to touch AndroidManifest. Instead do the following:

  1. right click on the root folder of your project.
  2. Click "Open Module Setting".
  3. Go to the Flavours tab (It might also be called Default Config in the newer versions).
  4. Change the applicationID to whatever package name you want. Press OK.

Note this will not change the package name. The decoupling of Package Name and Application ID is explained here: http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename

24
  • 8
    This only changes the name in gradle, and nowhere else.
    – Jacob R
    Mar 23, 2015 at 18:47
  • 6
    This is one holy grail answer! Very Smart!
    – sud007
    Jun 9, 2015 at 7:13
  • 4
    This needs to be chosen as a correct answer since it is very simple and fast way to follow. Jun 29, 2015 at 8:21
  • 7
    This needs to be accepted, other answer are lengthy and you can't change com.example.sample to com.example using other answers Oct 25, 2015 at 17:14
  • 3
    If you are trying to change your package name to upload into playstore this is for you.
    – sibin
    Feb 11, 2019 at 3:18
109

The approach used by me for renaming the package name is as follows:-

Step 1 : Select the Project option from the left menu of Android Studio

enter image description here

Step 2 : Right-click on java and add a new package and set the desired package name

enter image description here

Step 3 : Enter your new package name

enter image description here

Step 4 :Copy all the files from your old package and paste into the new package

enter image description here

Step 5 :Rename the package name in the manifest file

enter image description here

Step 6 :Rename the package name in build.gradle file

enter image description here

Step 7 :Then right-click the old package and delete it with all its data, and delete that directory as well

enter image description here

Step 8 :Then Rebuild your project

enter image description here

Step 9 :Then you will find some errors of old import packagename in your project Select the old package name in any file and press CTRL + Shift + R , and enter your new package name in replace box, then press find

enter image description here

Step 10 :Then a popup appears like below and select the All files option from it

enter image description here

Step 11 :Rebuild your project again, bingo your project packagename has been changed :)

8
  • 2
    Replace In Path is no longer available tru Shift + R in Android studio 2.3.3, highlight the old path, go to Edit -> Find -> Replace In Path. Also make sure to update your gradle files. Cheers
    – ralphgabb
    Jun 21, 2017 at 2:41
  • 1
    Did not get any errors with old package name. So, didn't have to do anything after step 9. Thanks! Aug 15, 2017 at 17:34
  • 1
    If you did not get any errors, then do not go after step 9 Aug 17, 2017 at 17:09
  • 1
    Error:Execution failed for task ':app:compileDebugAidl'. > java.io.IOException: com.android.ide.common.process.ProcessException: Jan 2, 2018 at 11:24
  • 1
    Instead of Copy, I just Moved and by using this operation instead, I didn't had any erros after rebuild.
    – Cavaleiro
    Apr 5, 2020 at 11:19
84
  1. Go to your AndroidManifest.xml file.

  2. Place your cursor in the package name as shown below. Don't select it, just place it.

    Enter image description here

  3. Then press Shift + F6 and you will get a popup window as shown below. Select Rename package.

    Enter image description here

  4. Enter your new name and select Refactor. (Note: since my cursor is on "something", only something is renamed.)

That's it done.

8
  • 1
    Thanks working on Android Studio 1.5.1 It changes package automatically No need to create new package and drag and drop files and delete old package Blah Blah Blah
    – Zeeshan
    Mar 7, 2016 at 21:37
  • @Prince Jayakumar, your 'don't select it just place it' statement is confusing. just by placing the mouse cursor, shft+f6 won't work. If the caret is somewhere else in the file then you've to click at the package name, then shft+f6 will work
    – Prabs
    Dec 28, 2016 at 8:59
  • 1
    Easiest way to change package name! Jun 19, 2018 at 21:28
  • 1
    This is the best solution!!
    – Seb83
    Jan 29, 2020 at 14:38
  • 1
    not working i am pressing shift +f6 its not working
    – Ahmad
    Aug 31, 2020 at 7:38
47

Right-click on the package at the Project Panel.

Choose Refactor -> Rename from the context menu.

6
  • 1
    this worked great for me, also had to update the AndroidManifest file too.
    – physphil
    Apr 5, 2014 at 17:50
  • 124
    Refactor > Rename only allows me to rename the last part of the package, e.g. the app in com.example.mypackage.app May 16, 2014 at 18:08
  • 1
    I did this way but Now it says class not exist at launch time. How did you renamed it?
    – Dharmik
    Nov 12, 2014 at 14:14
  • I have used the "Refactor" main menu and click on "Rename".
    – Codebeat
    Apr 25, 2015 at 18:49
  • @GilliMonsta you can select your app folder in right side panel click settings and un-check Compact Empty Middle Packages Nov 24, 2015 at 8:11
42

Change the Package Name


To rename your package name, all you have to do is go to your AndroidManifest.xml file and put your mouse cursor in front of the part of the package name you want to change.


enter image description here


Right-Click > Refactor > Rename


enter image description here


In the new window press Rename package


enter image description here


Change name and press Refactor


enter image description here


…and press Do Refactor at the bottom.


enter image description here


Your package name usually is in format com.domain.appname; in this example we changed the appname part, but you can do the same steps for the domain too.

Done! You have changed your package name!

4
  • 5
    Beautiful answer...quick and precise.. No long steps.
    – Noman
    Nov 3, 2020 at 18:41
  • 3
    the best answer here Dec 21, 2021 at 10:17
  • 1
    Well done BUT it only replaces part of the package like "com" or any other selected! To replce the Whole string/package name require another solution!
    – CryptoCode
    Jan 17, 2022 at 8:58
  • Followed these steps (not realizing they were out of date). Android Studio tried to build for 2 minutes before failing with the error: "Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported." Well damn Android Studio, you clearly know what I'm trying to do! Why not just do it, then give a warning popup if you really must
    – ETL
    Jun 2, 2023 at 4:49
40

Android Studio 2023


Step by Step Implementation

Step 1: To rename package name in Android studio open your project in Android mode first as shown in the below image.

Step 2: Now click on the setting gear icon and deselect Compact Middle Packages.

Step 3: Now the packages folder is broken into parts as shown in the below image.

Step 4: Now right-click on the first package name (com) and Refactor > Rename. A warning message will be displayed but go ahead and click on the Rename current button.

Step 5: Rename the directory name as your requirement and click on the Refactor button.

Note: Go to Build > Rebuild Project to display the updated name.

Now you can see your directory name changes from com -> gfg as shown in the below image.

Step 6: Do the same for the domain extension and App folder name according to your requirement.

Now you can see the package name has been changed from com.example.pulltorefreshwithlistview to gfg.geeksforgeeks.listview as shown in the below image.

Step 7: Now go to the build.gradle (Module: app) in Gradle Scripts. Here change the applicationId and click on Sync Now. And you are successfully renamed your package name.


Source:

4
  • it left empty folders of old package name and didn't change all imports. Try it in real project with multiple modules
    – user924
    May 24, 2023 at 12:05
  • 1
    Finally, I have followed this one.
    – Maruf Alam
    Jun 6, 2023 at 11:55
  • 1
    I also had an applicationId and namespace entry in my module build.gradle that I had to change.
    – hBrent
    Aug 15, 2023 at 0:15
  • there is no gear icon there anymore. Ubuntu 22 Iguana Android Studio here. Got confused and passing to other answers. (Pls update the answer)
    – CodeToLife
    Apr 11 at 14:23
33
  1. Open the file:

    app → manifests → AndroidManifest.xml

    Enter image description here

    Highlight each part in the package name that you want to modify (don't highlight the entire package name) then:

    • Mouse right-click → Refactor → Rename → Rename package
    • type the new name and press (Refactor)

    Do these steps in each part of the package name.

    Enter image description here

  2. Open (Gradle Script) >> (build.gradle(Modul:app))

    and update the applicationId to your package name

    Enter image description here

  3. Open the menu (build) and choose (Rebuild Project).

5
  • I tried doing this and I hit a snag. I'm trying to change the com.example.android.package to my own domain (which ends .net). I can change 'example' and 'package', but I can't change the 'com'. It also doesn't rename any directories. Any tips?
    – Rob Rose
    Jul 24, 2015 at 17:09
  • @RobertRose, I have a solution for your issue. Are you still working on it? Aug 14, 2015 at 0:18
  • I put it aside and just went ahead and left it. It's not production. For future reference, what did you come up with?
    – Rob Rose
    Aug 15, 2015 at 4:28
  • 1st one does not work if i have "xxx.mydomain.com" kind of package)
    – Jemshit
    Aug 22, 2015 at 15:54
  • beautiful. the second steps are essential and usually looked over in most answers.
    – AlleyOOP
    Dec 26, 2015 at 9:00
20

I have seen the top voted answers but i found is a little bit different to do this, i try to do the most complete tutorial.

From the Android Studio click over the gear icon ( Gears icon ) and then select the option: "Compact Empty Middle Packages", to see the folders separated in a tree view.

introducir la descripción de la imagen aquí

Now select the folder, click right button to open the contextual menu, select Refactor and then Rename

introducir la descripción de la imagen aquí

You will be advised to refactor the package:

introducir la descripción de la imagen aquí

Then a window will show the coincidences inside the proyect, select "Do Refactor":

introducir la descripción de la imagen aquí

We don´t have to change manually the AndroidManifest.xml or build.gradle files, Refactoring the package will do the job!.

20

Select the package that will be refactored. RefactorMove"Move xxx to new package".

2
  • this is d easy method
    – droid kid
    Feb 3, 2015 at 7:19
  • 4
    Doesn't work, changed my package from "com.company.oldname" to "com.company.newname.oldname". See? This method doesn't allow to change the last component of the name (and I tried several times). Jun 23, 2015 at 15:17
19

IntelliJ IDEA has an option called "Compact Empty Middle Packages". Select the option icon of the Project tab and de/activate this.

See: How can I change top level package name in IntelliJ IDEA?

4
  • 1
    This was useful. After 'Deactivating' this feature things were much clearer and I could delete packages that were empty Aug 12, 2014 at 16:28
  • @ChrisNevill and how did u delete those empty packages please?
    – beretis
    Feb 11, 2015 at 12:35
  • I think I just selected them and pressed delete. I can't reproduce the issue at the moment so can't remember it exactly. Feb 11, 2015 at 17:06
  • I agree, this was REALLY useful. Should be included in all the sub-standard answers I've seen regarding this topic.
    – iaindownie
    Dec 17, 2015 at 14:22
14

I also had a hard time changing the package name of a project. Especially big projects. It has so much to do, but those jobs are really boring. I've been developing a plugin on IntelliJ IDEA and Android Studio. It will help you to automatically change the package name automatically. It's called Android Package Renamer

Installation

  • Using IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for "Android Package Renamer" > Install Plugin

  • Manually:

    Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...

Usage

  1. Open Your Project.
  2. Click -> File -> Rename Package
  3. Input the Package you want to change.
  4. Click Ok.
  5. Sync Project with Gradle Files or Invalidate Caches

This plugin can rename packages (it can do more):

  • com.android.example -> org.nickseven.product
  • com.android.example -> org.nickseven
  • com.android.example -> org.nickseven.product.native
  • com.android.etc.nick.d -> org.android.otd.nick.d

If this plugin helps you or there is an error, contact me through the following GitHub

4
  • The plugin worked like magic:)
    – yazmnh87
    Mar 13, 2023 at 18:12
  • didn't work for multi module projects, also lefts empty folders, basically renamed app module only, and partially the second module, all others modules remained unchanged
    – user924
    May 24, 2023 at 12:57
  • @user924 I think you are right, you can create an issue on my github, I will support your case in the next version
    – Phuc VR
    May 24, 2023 at 14:32
  • Much love brother, thanks!
    – Tim
    Jul 9, 2023 at 6:42
12

Quick and easy way in 3 steps:

1- open MainActivity or any other java or Kotlin file.

At the top there is the package declaration such as:

package com.example.myapp;

select the package portion that you want to change and press Shift+F6. I personally want to change the example.

In the warning dialog, select Rename package and then insert the desired package name.

2- Open AndroidManifest.xml and inside <manifest> tag change the package to the desired package name.

3- open build.gradle(Module: app) and change the applicationId to the desired package name.

1
  • Thank you. It is quite simple and straightforward. Aug 19, 2017 at 14:19
11

If your package name is more than two dot separated, say com.hello.world and moreover, you did not put anything in com/ and com/hello/. All of your classes are putting into com/hello/world/, you might DO the following steps to refactoring your package name(s) in Android Studio or IntelliJ:

  • [FIRST] Add something under your directories(com/, com/hello/). You can achieve this by first add two files to package com.hello.world, say
   com.hello.world.PackageInfo1.java
   com.hello.world.PackageInfo2.java

then refactor them by moving them to com and com.hello respectively. You will see com and com.hello sitting there at the Project(Alt+1 or Command+1 for shortcut) and rename directories refactoring is waiting there as you expected.

  • Refactor to rename one or more of these directories to reach your aim. The only thing you should notice here is you must choose the directories rather than Packages when a dialog ask you.

  • If you've got lots of classes in your project, it will take you a while to wait for its auto-scan-and-rename.

  • Besides, you need to rename the package name inside the AndroidManifest.xml manually, I guess, such that other names in this file can benefit the prefix.

  • [ALSO], it might need you to replace all com.hello.world.R to the new XXX.XXX.XXX.R(Command+Shift+R for short)

  • Rebuild and run your project to see whether it work. And use "Find in Path" to find other non-touch names you'd like to rename.

  • Enjoy it.
0
9

Be sure to go to Sheharyar's great Answer. There are so many answers and comments that follow it that it would be easy to get confused and give up, but don't. That answer works.

In short, you do three things:

(1) Deselect Compact Empty Middle Packages.

(2) Refactor then Rename each old directory node by choosing Change Package (not Change Directory) to match the new package name. (Be sure to do a preview of changes.)

(3) Edit the build.gradle file and make APPLICATION_ID match the new package name.

2
  • 4
    Whoever downvoted this truly is missing something, since my Answer is a synopsis of Sheharyar's answer THAT GOT 332 UPVOTES and all I did was simpllify it since it looks so involved (it isn't). The nerve of some shortsighted, trigger-happy people. Would LOVE to see reason for downvote. Have no doubt I won't see it.
    – DSlomer64
    Oct 20, 2015 at 18:34
  • OK. As of 3.5 years later, I can maybe see why the downvotes might have been cast since it might not have been completely clear as it WAS (but cut some slack!), but it sure is now, thanks to @Peter Mortensen's two-day-old edit and mine just now.
    – DSlomer64
    Jan 3, 2019 at 10:28
8

I've found a way easier solution to this problem which also changed the generated imports like com.test.testpackagechange.R and only takes about a minute.

Your first step is to open Android Studio and open the replace all window (Mac: cmd + shift + R, Windows I assume: ctrl + shift + R). Type in your old package name and in the one below your new package name. Click Find. This may take a while because it is also looking through the generated items. If it has over 1000 hits, just click continue.

enter image description here

After you've done that push Replace All to replace your old package name with your new one.

enter image description here

Now close Android Studio and go to Finder on Mac or Windows Explorer on Windows. Change the name of the folders to your new package name, like this:

enter image description here

Now open Android Studio again. Gradle will sync and your package name should be changed to the new one.

I've found this to be the easiest one and the one that covers all areas like generated files.

8

The common mistake that one can make is one cannot rename the package structure i.e. it is not possible to change com.name.android to com.Renamed.android when one tries to modify at the com.name.android level.

In order to have the same desired change go one level up i.e com.name and here when you refactor change it to Renamed. This will work always.

8
  1. Select the package name in the Java folder.
  2. Shift+F6
  3. Change the package name and click OK.

Your package name will be changed from all the Java files and the manifest file. You have to manually change the package name from build.gradle.

1
  • 1
    If Shift+F6 is not working for you, then you can try Alt+Shift+R to refactor the package. Rest of the procedure is the same Mar 10, 2016 at 14:33
7

Packages serve two purposes. One is to uniquely identify your app in the Google Play Store. The other is to name the package for the R.java class which is generated when you build your project. You can think of the first purpose as the external package and the second as the internal package. Assuming you want to change the external package so you can identify in the Play store, there's a convenient way to do this.

In Android Studio,

 choose File -> Project Structure -> Choose your app's module -> Click on the 
 Flavors tab -> change the Application id.

Now, when you build your project, your APK and manifest will use this new package name.

7

I found another way that works or an extra step to some of the answers here especially if you want to change the domain as well. It works in Android Studio 1.4. This is what I did:

  1. Open Manifest.xml and change the package name to what you want.
  2. Open your app build.gradle file and change the Application Id in defaultConfig to the same name as in manifest and rebuild the project.
  3. If still an issue, open a file under the package name, go to the package breadcrumbs (i.e. package declaration at head of file) and set your cursor to the domain you want to change and hit "Shift + F6", it would come out with a dialog with multiple use warnings, click on "Rename packages" and then click on "Do Refactor" it should rename everything including the R.Java files.

So for example if you want to rename "com.example.app" to "com.YourDomain.app", open a file under the package to be renamed, in the package breadcrumbs, set your cursor to "example" part of the domain and hit Shift + F6 and rename package to "YourDomain".

7

I tried the two top-voted solutions but found some issues even though both work to some extent.

  • List item: The new package-drag-drop method leaves some unchanged and creates some undesired effects
  • List item: The rename package only changes the last part of the package name

After some experiments, I found the following method works well for me.

If you just need to change the last part of the package name, use the method outlined by GreyBeardedGeek, namely

Right-click on the package in the Project pane. Choose Refactor -> Rename from the context menu

If you need to change the whole package name, do the following.

Right-click on the package in the Project pane. Choose Refactor -> Move from the context menu

This will create a new package folder (when necessary) but will keep the last part of your package name as before. If you need to change the last part, do the rename accordingly.

Note also that you may need to modify package names in e.g. build.gradle, manifest, and/or any xml resource files, or even in your code if hardcoded. After all that, do Sync/Clean/Rebuild project as necessary.

6

Updated answer: May 2015

OK I have been struggling with cloning & renaming projects in Android Studio, but finally I achieved it. Here are the steps to follow:

  1. Copy the project folder, rename it & open it with Android Studio
  2. Rename module directory from explorer
  3. Rename projectName.iml and content
  4. Rename idea/.name content
  5. In your Project pane, click on the little gear icon -> uncheck "Compact Empty Middle Package"
  6. Refactor src directories for new package name (rename package, "not rename directory")
  7. In build.gradle rename application id
  8. settings.gradle rename module

That's it...

6

How to rename com.example.app to com.android.app:

  1. in package com.example.app select example

  2. Shift + F6

  3. choose rename package

  4. rename example to android

  5. confirm do refactor

6

The best way is to write the new package name and drag from the older package name.

The second way, if you click Refactor then move option then rename the package name, it will rename the package name and then rebuild.

In Build.gradle you have to do manually, if you Refactor then it will not rename in Build.gradle.

6

Right click on package -> refactor and change the name.

You can also change it in the manifest. Sometimes if you change the package name, but after creating the .apk file it shows a different package name. At that time check "applicationId" in the build.gradle file.

6
  • The first part consists of creating a new package under the java folder and selecting then dragging all your source files from the old package to this new package. After that, you need to rename the package name in android manifest` to the name of the new package.

  • In step 2, here is what you need to do. You need to change the old package name in applicationId under the module build.gradle in your android studio in addition to changing the package name in the manifest. So in summary, click on build.gradle which is below the "AndroidManifest.xml" and modify the value of applicationId to your new package name.

  • Then, at the very top, under build. clean your project, then rebuild. It should be fine from here.

6

I recommend to use Sublime Text (or Notepad++). Replace com.one.lastname -> com.two.newname and com/one/lastname -> com/two/newname in ...\Projects[MyProject]. And don't forget to rename ...\Projects\MyProject\app\src\main\java\com\one\lastname, ...\Projects\MyProject\app\src\test\java\com\one\lastname and ...\Projects\MyProject\app\src\androidTest\java\com\one\lastname!

That's all:)

Screenshot

5

There are many answers given, but still, I am giving my attempt.

Step 1 : As Show in the fig above select the Setting Option... enter image description here

Step 2: Select Compact Middle Packages option... enter image description here

Step 3: Now Expand the package as shown enter image description here

Step 4: After expanding it will look something like enter image description here

Step 5: Select any on the subpackage (in or example or googledevsmsverify) and click Shift+f6 button... enter image description here

I selected middle package example so it will display as above fig simple rename the package and click on the refactor button

enter image description here

Step 6: you will see the following screen after clicking Refactor button, click on the DO Refactor, and wait until build the gradle... enter image description here

Step 7: Goto build.gradle(Mobile:app) and change the package name of applicationID as shown enter image description here

Step 8: Just check the package in the manifest.xml file...

enter image description here

All Done the package is change...@Ambilpura

5

THERE ARE TWO THINGS - PACKAGE NAME and APPLICATION ID.

The easiest and most satisfying way for me is this,

enter image description here

Can you see the highlighting line "vijayjangid", it was "example" before. All I did was renamed example using refractor and the android studio did all the work.

FIRST PART DONE.

Now rename the application id in defaultConfig brackets to the same as the name you renamed the example folder. Make sure you rename the package name and id in cloud services like firebase, Aws, realm, etc.

That's it you are done, the most upvoted answer is old, we need to update the answers.

Not the answer you're looking for? Browse other questions tagged or ask your own question.