Advise on renaming your Android project in Android Studio (Gradle)

In my current project, I want to rename the Android project in Android studio (0.8.9) and want to use it in the future. I know about the two solutions discussed in the forum. Can someone please confirm the best approach and hassle free. Moreover, any advice tested on Android Studio 0.8.9 is best.

Solutions I Know About (But Not Sure) A. - Close the project in question. Copy it and rename it to a new name and open it in Android Studio.
In this case, the project .iml file still shows the old name, as well as the .name file in the ".idea" folder. I also get this error:

Unsupported modules detected: compilation is not supported for the following modules :. Unfortunately, you cannot have non-Gradle Java modules and Android-Gradle modules in the same project.

B. Using option F6, but it is not copied. I think it moves the whole project, which is not a solution.

+6
source share
3 answers

When renaming a project, the following works for me:

  • Close Android Studio
  • Delete the * .iml file in the project root directory
  • Delete everything in the .idea directory except workspace.xml and tasks.xml .
  • Rename the project root directory to the new project name.
  • Restart Android Studio and import the project from the renamed directory.

Note. If you do not want to lose the workspace settings (window sizes, etc.), and you do not have any tasks, you can simply completely delete the .idea directory.

+16
source

In Android 1.5.1, the following were tested and processed:

  • Open the Project folder (you can open it through the Android studio itself, see.
  • make sure Android Studio is closed.
  • change yourOldProjectName.iml to the new name
  • rename the parent folder to the same new name.
  • re-open Android Studio -> File -> Open -> the path to your renamed.iml
+5
source

I found an easy way to solve this problem.

Open Android Studio, File -> Invalidate Caches / Restart -> Invalid Caches and Reboot.

0
source

Source: https://habr.com/ru/post/976665/


All Articles