owe owe - 19 days ago 6
Android Question

How to move and rename a project in android studio?

This should be a really simple question :)

I have a project that works fine. Now I wanted to rename it and to change the path of the projectfolder. First it seemd simple: right click -> "move" and "refactor/rename".

After moving and renaming my project folder and my apk modul there was not the same project-structur as before. My project libs have been included twice.
I looked in the '.iml' files and saw that the previous path was included - so I changed this. After this I could compile my project over the command line but not with the IDE. There I got this error:

NullPointerException: no project directory specified


Whats the default way to move and rename a project?
I solved my problem by making a new project and copying all files, but it would be very cool to know the solution of this "problem".

EDIT:

Origin Project-Structure:

MyProject
--- libraries
--- MyApp


After Moving:

MyProject
--- MyProject (new path)
--- MyProject (old path)


I think I have to do more than just copy the project. Somehow I have to specify the "new" project, havn't I?

Answer

Close the project in Android Studio (File -> Close Project). Move the project and rename it by moving its home folder/directory. Open the new project from Android Studio (File -> Open)

Comments