7

I tried to change my project name in Android Studio by the usual Refactor->Rename method, but since it did not really change it, it only made an add-on to the title OldName[NewName], I tried to just change the directory name itself. Since I will need that changed too. But then after I did that, I tried re-opening Android Studio and now it is freezing with the Waiting for ADB popup. Which I then have to use Activity Monitor to force quit Android Studio.

So, is there a proper way to change the name of your existing Android Studio project so that it really changes the name everywhere? Or are there a few steps to take to make sure it is changed everywhere? I also would then want my package renamed, since it took the name of my app name at creation. Thanks for your help.

Azurespot
  • 3,066
  • 3
  • 45
  • 73

5 Answers5

16

In Android Studio you can change the name of the Android project in the file:

.idea/.name

location of file

Then File -> Invalidate caches/Restart

Upd:

Things have changed, so now just in the

settings.gradle

file change or create the line

rootProject.name = 'Your project name'
Andrew
  • 36,676
  • 11
  • 141
  • 113
6

The name of your application is not related to your Eclipse project name, open your res/values/strings.xml and modify app_name item to change your application name. You should change the name of your application from androidManifest.xml

android manifest

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >

strings.xml

<string name="app_name">newnameofapp</string>

By changing the package name also a method... try

Right click on the project -> Android Tools -> Rename Application package
Jocheved
  • 1,125
  • 3
  • 15
  • 32
  • Hi J, thanks... but I am using Android Studio, so there is no "Android Tools" when I right click on the project. However renaming the strings.xml and the android manifest did work well, thx. Do you happen to know how to rename the package in Android Studio? – Azurespot Mar 14 '14 at 04:57
  • I also cannot figure out how to change the project name. I've refactored, renamed and the app works properly, but it still lists as the old project name in the "Welcome to Android Studio" screen under recent projects even though it shows a different path. There is also no.project file so I can't change it there. – dbconfession Aug 31 '14 at 19:32
  • this worked. my app installed as the name i put at newnameofapp – Doug Cassidy Mar 10 '16 at 23:23
  • Question is about Project name, not Application name. – Pointer Null Apr 15 '16 at 11:26
6
idea/.name 

Change the file content then restart android studio. Works for me.

deW1
  • 5,562
  • 10
  • 38
  • 54
Khan
  • 151
  • 1
  • 4
  • I already changed the string in .name file but Restarting Android Studio did the trick. For every simple task like changing package name, project name etc. Android Studio has failed. Even after applying the solution, there has to be a restart. Well! that doesn't take any lesser time. Not happy :(. Thanks for your help @test , your answer helped me. Thanks again. – class Android Mar 02 '16 at 14:09
  • 1
    Nope, still not there. Changes Project name, but not app name. – class Android Mar 02 '16 at 14:11
2

Go to [Tool Window\Project] by Alt+1, and change the level on the top-left corner of this window to Project (the other two are Packages and Android), then you can rename the Project name by Shift+F6. Type in the new name and press OK.

If you just want to change the app name which appears in the system, you can modify the android:title in the manifest.xml.

Rick
  • 3,240
  • 2
  • 29
  • 53
蓝钦城
  • 53
  • 5
0

I think the best way to do it is to import the project into Eclipse. Change project name and refactor paths in Eclipse. It is easy in Eclipse. Then import the project into android-studio.
Yes, it seems that IJ has some interesting functionality (including refactoring) but some functionality does not work. It works in Eclipse and I hope that google is listening and will provide SDK for Eclipse again. Or at least explain why they dropped Eclipse and went to IJ. I just hope that the reason is not that AS was "invented" in google but Eclipse was not. (NIH syndrome).

jim
  • 1