Reputation: 1683
How to change the name of a project's root directory in Android Studio 0.9.9. I read the other solution here but nothing works for me. I can change/refactor the package name but not the name of the root directory. I found another solution here, which is to change the name in .idea/.name
file, which didn't work. After I changed name, I tried cleaning, rebuilding etc. but nothing reflected the changes in Android Studio. There is no REFACTOR option for "PROJECT NAME / ROOT DIRECTORY NAME", many people here confused the module name with project name / root directory name.
Upvotes: 43
Views: 78595
Reputation: 12513
I have already up-voted to @Gorcyn's answer. However, it became a bit old info. So I try to update based on my own experience with Android Studio from 4.1.3 to Arctic Fox:
rootProject.name
parameter in the project root settings.gradle
file.fileurl
and filepath
attributes in the .idea/modules.xml
file..iml
filename under the .idea/modules
(or project root) directory to correspond to the updated fileurl
and filepath
.external.linked.project.id
attribute or the external.system.module.group
attribute in each .iml
file renamed above.Upvotes: 0
Reputation: 1
My solution is:
.gradel
and .idea
Upvotes: -1
Reputation: 2817
Basically you can by changing the project's folder name and reopening it.
It is also recommended to change the name of the project in the Android Studio project structure by editing these files:
.idea/.name
[Name].iml
file in the project root directory.idea\modules.xml
rootProject.name
in the project root settings.gradle
Upvotes: 71
Reputation: 61
To change the name of the project's root directory, the following worked for me: As the image bellow indicates, under the 'Project' tab,
go to setting.gradle
modify/include rootProject.name='put the name you want here'
Then go to build -> clean project
build -> rebuild project
Upvotes: 0
Reputation: 405
My sure shot answer is : To refactor the root name
a) Rename the folder
b) then please go in settings.gradle > just write rootProject.name = 'new name'
Upvotes: 2
Reputation: 16062
Refactor -> Rename
Rename directory -> Ok
.settings.gradle
and rename the :app
from include ':app'
with the new folder name including the :
Upvotes: 1
Reputation: 123
To avoid problems, use refactor: Change the left view from "Android" (where you see the files) to "Project". Right click on your project and select "Refactor/Copy". Now create your new project folder with windows explorer (otherwise you might get an IO Exception). After refactoring, be sure to select "Build/Clean Project" and then "Build/Make Project".
Upvotes: 0
Reputation: 15759
File->Close project
Change project root directory name
Delete .iml files (by searching for them using windows search then deleting them)
Delete .idea directory
Open the project
Upvotes: 12
Reputation: 183
The easiest way I have found to do this is to copy the project and then change the root folder name on the copy. Then just open copy as a new project in Android Studio.
Upvotes: 1
Reputation: 577
Close android studio
Change project root directory name
Open android studio
Open the project(not from local history but by browsing to it)
Worked for me @ Studio 2.1.3
Upvotes: 24
Reputation: 398
This needs to be done manually. Can't understand why refactoring is not working.. Rename folder and then respective files
Upvotes: 1