Ercross
Ercross

Reputation: 646

How to change project name on Android Studio 3+

How can I change the project name of an Android project after it has been created while not breaking anything

Upvotes: 2

Views: 4059

Answers (1)

Ercross
Ercross

Reputation: 646

Most answers addressing this question are somehow outdated and does not work with the Android Studio 3+ version. This is what works for me and should work if you wish to change the project name (name of the project root folder, usually located at the directory C:/.../AndroidStudioProjects on your computer), application ID (the name used to identify your app on Play Store).

Note that you cannot change an app's application ID after it has been published to Play Store, except if you want to create another application using the same code (i.e., changing the ID after Play Store publication would cause Play Store to assume the app is a different one than the one bearing the previous application ID even if they offer the same functionality)

Starting with the project name, say project name is MyFirstApp, Open Android Studio, locate the settings.gradle file of that project, change the value of this attribute rootProject.name= to the new name you want for the project. Close Android Studio, locate the MyFirstApp folder within AndroidStudioProjects folder on your computer directory, right click on the folder and select rename from the dialog box. Then enter the new name you prefer. Open Android Studio, on the top left corner, click file>>open>>MyFirstApp. You should get a sync successful.

To change application ID is easier, just change the attribute of : 1. applicationId in build.grade(Module) to the new application ID you want 2. app_name in strings.xml to the new application ID you want 3. Ensure the value of android:label in AndroidManifest.xml is set to "@string/app_name"

To rename any other file in your project on Android Studio, simply right click on the file on the project directory (usually the pane on the top left of Android Studio), select refactor>>rename file. Ensure you keep these boxes checked search for references and search in comments and strings

Upvotes: 2

Related Questions