How to rename root module in android studio? I have tried (right click the module then click refactor then click rename) but I got warning "can't rename root module"
Step 1: To rename package name in Android studio open your project in Android mode first as shown in the below image. Step 2: Now click on the setting gear icon and deselect Compact Middle Packages. Step 3: Now the packages folder is broken into parts as shown in the below image.
First, open the project directory by right-clicking on the project name and click at show in explorer option. Step 2: Close the android studio, and go to the window explorer of the project directory and rename the root folder with a new name.
Inside the main directory you have two directories named java and res . The java directory is the root of the Java source code for the Android app.
I pressed Ctrl+Shift+F to search my current root module name and found the name to be in the settings.gradle
file as rootProject.name=...
. I renamed it and synced the project (File -> Sync Project with Gradle Files) and the root module name was updated.
In root of your project open setting.gradle and change rootProject.name='YOUR NEW NAME'
then close and restart android studio
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