I picked the wrong name of a specific module which I imported to the Gradle project in Android Studio.
As of Android Studio 3.4.1
Rename module
Refactor > Rename
Rename module
and press OK
OK
settings.gradle
is updated automatically. However, you must manually update any build.gradle
dependencies to reflect new module name:dependencies {
// manually update this after renaming the module
implementation project(':newmodulename')
}
Rename package to reflect new module name
Refactor > Rename
test
or androidTest
), a dialog will ask if you want to rename them as well. If so, select Rename package
Refactor
Do Refactor
in the Refactoring PreviewTip: Select
File > Invalidate Caches / Restart
to fix any unresolved resource references caused by renaming a module.