Android studio change project name exception solution: can’t rename root module

Programmer algorithm practice must read, common Java API skills to share>>>

When modifying the name of project in Android studio, prompt “can’t rename root module”

This is because Android studio can only modify all files in the root directory. To modify the name of the project root directory, you can only close Android studio and modify the folder name in the operating system

Specific steps:

1. Close Android studio

2. Modify the name directly in the operating system

3. Re import the project with a new name ([newname]), which is quite simple

In fact, after re importing, Android studio automatically modifies the name references in related projects, including the following two aspects:

1. Modify the. IML file name in the root directory to [newname]. IML, and fix the external. Linked. Project. Id = [newname] in the file

2. Modify & lt; in. Idea/modules. XML; module fileurl=”file://$PROJECT_ DIR$/[NewName].iml” filepath=”$PROJECT_ DIR$/[NewName].iml” />

Because these changes are automatically completed by Android studio, there is no need to modify them manually. This will change the name of the project

Similar Posts: