Renaming modules in Android Studio?

前端 未结 9 2516
闹比i
闹比i 2020-12-12 18:05

I picked the wrong name of a specific module which I imported to the Gradle project in Android Studio.

\"\"

9条回答
  •  伪装坚强ぢ
    2020-12-12 18:40

    In AndroidStudio 2.2.2 renaming the module alone via refactor/rename worked for me. (32-bit linux Mint)

    The rename dialog presents two options: "directory" or "module" (radio buttons so mutually exclusive, at least in one pass). I wasn't sure which to pick so I ended here looking for an answer. One answer said "do both" as two steps, another answer said "do module, then directory" as two steps. So I chose "module" first. To my surprise that was all that was needed, both module and directory were changed. settings.gradle was updated by the refactor/rename in the one step as well.

    "gradle synce" and "clean build" were also triggered. Upon build to my tablet, no complaint about the name change.

    just adding this answer in case someone else with 2.2.2 or later is unsure which to pick. Also to re-iterate what others have said, back up your project first.

提交回复
热议问题