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
In Android Studio, I found both of the following to work OK for a project which has been copied|moved|renamed.
Approach: Import
Approach: Syn Project with Gradle Files
Both have the same outcome.
Import
is one less step. Import
is conveniently located on the welcome screen and File > New menu.
Sync Project with Gradle Files
is a somewhat more obscure menu item. However, Sync Project with Gradle Files
is a good fallback if you click open when intending to Import
.
Move project files as you like and then:
Tools -> Android -> Sync Project with Gradle Files
I just successfully moved my C:\ project into my portable M:\ drive.
I know it's a bit of a drag, but this is the only working method I have found to move a project from one destination to another and still have a viable work product.
PS: I was searching for this query about an hour ago, with no success. After getting a positive result myself I thought I would share the result with the community... even if the thread is two years old and already marked as answered. After all, it may help the next person who is searching for a quick result, like I was.
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.
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)
What works for me:
1. Moving Project:
Close Android Studio .You can try to copy and paste the project normally. If there is Path error due to path to long. What I do normaly is compressing the project to rar file. copy paste to new location and extract It. For winrar use extract here as the actual root folder is inside the rar
2. Rename the project:
Rename the root folder to your new project name.
3. Open In Android Studio
Notice that when you open android studio, it will open the old project file by default. Close the project by going to File>Close Project. Then open your new project.