How to move and rename a project in android studio?

前端 未结 12 1209
一向
一向 2021-02-01 15:33

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

12条回答
  •  长情又很酷
    2021-02-01 15:39

    In Android Studio, I found both of the following to work OK for a project which has been copied|moved|renamed.

    Approach: Import

    1. Build > Clean Project
    2. File > Close Project
    3. Copy, Move, and/or Rename Folder
    4. Delete /old_name.iml (no longer needed)
    5. File > New > Import Project...

    Approach: Syn Project with Gradle Files

    1. Build > Clean Project
    2. File > Close Project
    3. Copy, Move, and/or Rename Folder
    4. Delete /old_name.iml (no longer needed)
    5. File > Open
    6. Tools > Android > Sync 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.

提交回复
热议问题