Is it possible to change the project name and package name in Android.
-
7It is possible, as answers below tell you. I just have to add that if you've published your app to Android Market, you will have to do it all over. Meaning you'll loose all your current users, possibly having to maintain two instances of the app on Android Market simultaneously while you notify users of the change - as the package name isn't the same anymore. So think it through before you decide to change. – Joakim Berglund Feb 28 '11 at 01:55
17 Answers
Project Name:
res -> values -> strings.xml -> app_name -> (change the name)
Package name:
Right click on the project -> Android tools -> Rename application package -> (change the name)
- 51,960
- 37
- 141
- 201
- 359
- 1
- 3
- 5
Change Package Name :
Right Click on Project >Android Tools >Rename Application Package
Go to src right click on your main package >Refactor >Rename
Go to manifest file and change your package name .
Change Project Name :
Right click on Project Refactor >Rename
- 8,783
- 11
- 53
- 95
- 677
- 7
- 9
-
1Thank you, this is the only reply that almost fully answers the question... The 5th step is to update the __values\strings.xml__ `app_name` line (as others mentioned) and if you support multiple languages, update also __values-[language]\strings.xml__. – Armfoot Sep 03 '14 at 14:34
-
However, there's one thing I noticed that I haven't been able to change. When I click the down arrow near the __Run Icon__ the old name of the project is still there... Any guess? – Armfoot Sep 03 '14 at 15:06
-
1Sorry if this is a noob question. Where is the 'Project' which I should right click? – Sanath Bharadwaj Mar 11 '18 at 08:00
Try this
- Right click on your project.
- Click "Refactor"
- Click "Rename..."
- List item
Enter name!
Or did that not work for you?
- 188
- 1
- 10
-
2When I tried this today it didn't work with "Can't rename root module" – kangkyu Jul 03 '18 at 00:20
-
it is not going to work if you want to rename root module ; so goto manifest.xml file and change the name – Imran Sep 08 '19 at 04:44
You change it in the manifest file. That is where you can change a whole bunch of settings about the android project itself.
- 13,101
- 7
- 54
- 72
-
Thanks, I can change the package from the manifest. But what about the visible project name? The android project name. Thanks – Tommy Feb 28 '11 at 01:37
-
Okay do you mean the project name that appears in you IDE (Eclipse?) or the one that appears when you put the app on your phone/tablet? – Robert Massaioli Feb 28 '11 at 01:45
-
1The project name that appears in the IDE, the project explorer. But it doesn't matter now as I got the application to work in another project. Thanks – Tommy Feb 28 '11 at 02:09
-
1@Deqing actually he doesn't mention how to change the package name and strings.xml. Check **ritesh4326**'s answer instead and the comments :P – Armfoot Sep 03 '14 at 15:11
1. Right click on project in project pane.
2. Click "Open module settings"
3. In the project structure frame, click app below the Modules
4. Click "Flavors" and change "Application Id".
5. Edit Manifest.xml in your project and rebuild it.
- 855
- 1
- 15
- 31
-
10. Open project pane (upper left) 1. Right click on App in project pane. Continue via step 2 – Neo42 Jan 30 '18 at 19:01
If you want to change the name of your application as it shows on the phone just change the value in the app_name variable. The Path is res -> values -> strings.xml -> app_name
- 13,103
- 13
- 78
- 104
I just finish modifying the package name and I hope this will help. I am using eclipse.
First you should have a backup of your AndroidManifest.xml, then you can select Refactor -> Rename to the package you want to change the name.
My eclipse Refactor will change the AndroidManifest.xml and make it not even able to compile, so I just paste the AndroidManifest.xml I backup, and change the package name by myself to the new one.
By the way, you should clean your project first, so the file auto generated in the gen folder will be cleaned.
When you build again with your new AndroidManifest.xml, you will get the correct gen folder.
Hope it helps.
- 903
- 3
- 12
- 26
If You're trying to change the root module name and getting "Can't rename root module" error , open the gradle.settings file and change the rootProject.name to whatever you want then sync .
- 2,107
- 3
- 26
- 29
- Right click on package name in one of your java class or activity, then reactor it and write your own package name then click ok.
- Open the manifest and change your package name according to your package name in java class
- 51
- 3
The project name is defined in the file .project as below. It is at the same level of your AndroidManifest.xml. I experienced it when I wanted to add to my workspace a project with the same projectName of an existing one and could find where it was defined. The Manifest file does not help in such case.
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>YourProjectName</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
- 3,512
- 7
- 38
- 93
For change your package name of any application.
Try this
1 . Right Click on project name go to android tools then rename application package enter new package name then click ok and update according to it.
2.Go to your main package name then right click then refactor and rename enter new package name.
3.Go to manifest and change old package with the new package name.
Now you can run your project.
- 4,617
- 39
- 52
- 69
- 556
- 2
- 9
- 26
Let me add a little to Robert Massaioli's answer.
If you have custom attributes used in your XML files (Creating a View Class), you'll also have to rename your XML namespaces.
xmlns:custom="http://schemas.android.com/apk/res/com.myold"
must be renamed to
xmlns:custom="http://schemas.android.com/apk/res/com.mynew"
- 1
- 1
- 5,645
- 10
- 66
- 130
Are you referring to the android:label attribute of the application tag in the manifest? If so, you could set it directly like so:
<application
...
android:label="My title"
... >
Or configure the string resource this points to by default, I think it was called app_name. Open the file strings.xml in the project subfolder res/values/ and edit it there.
- 3,523
- 1
- 23
- 17
1) Close Android Studio
2) Copy Old Project and rename it to the new one
3) Reopen android studio and import the new project
4) Go to the old package name and rename it according to your new project
5) Them, Click on Edit ==> Find ==> Replace in Path and replace old occurrences of your old project name to the new one
6) Clean the project and rebuild again
Thats it
In this Sample I want to change My Application Title to Surah Al Baqrah with Translation.
Change your view to Android. Go to App --> Res --> Values --> Strings.xml You can update the code below:
<string name="app_name">My Application</string>
which will look like:
to:
<resources>
<string name="app_name">Surah Al Baqrah with Translation</string>
</resources>
which will look like:
- 588
- 1
- 8
- 17
- 386
- 1
- 7