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?
Open the settings. gradle file with a text editor, like VSCode, and change the rootProject.name to your new project name. Done!
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)
In Android studio 0.8.+, you can click F6
to move it.
If you use 1.0.2 or higher, make sure you select the Project view for the Refactor -> Move menu option to become available.
Thanks to @DavidsAlias for pointing this out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With