Change project name on Android Studio
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Overview
Changing the project name in Android Studio is a common task that developers may need to perform for various reasons, such as rebranding or restructuring their applications. This operation involves more than just renaming a directory; it requires updates across multiple files and settings within the project. This guide provides a comprehensive step-by-step process for effectively changing the project name using Android Studio.
Steps to Change the Project Name
Step 1: Change the Project Directory Name
The first step is to change the name of the project directory itself. This is typically done outside Android Studio using your operating system's file explorer or terminal.
Windows:
- Navigate to the project directory.
- Right-click and select "Rename".
- Enter the new desired name.
macOS/Linux:
- Open the terminal.
- Use the
mvcommand:
Step 2: Adjust Settings in Android Studio
- Open the renamed project directory in Android Studio.
- Let the IDE index and resolve any initial errors.
Step 3: Update the settings.gradle File
In the settings.gradle file, update the rootProject.name entry to reflect the new project name.
Step 4: Update the build.gradle Files
Ensure that the applicationId inside the build.gradle file is correct and reflects any intended changes related to your project's new name. While the applicationId is not directly related to the project name, changes often accompany rebranding:
Step 5: Update Associated Files and Artifacts
- AndroidManifest.xml: Ensure that your package names and any path references correlate with your new project settings.
- Source Code (if applicable): Update any hardcoded references to the old project name in your source code, including Java/Kotlin package names if they need renaming.
Step 6: Refactor Package Name (Optional)
If rebranding requires changing the Java/Kotlin package name, follow this process:
- In the
Projectview, navigate tosrc > main > java > com > example > oldprojectname. - Right-click the folder, choose
Refactor, thenRename. - Use the refactoring tool to update the package across the entire project, ensuring code stability.
Step 7: Synchronize and Rebuild
After making all necessary changes:
- Sync the Gradle files.
- Run a clean build to ensure that everything compiles correctly:
Key Considerations
- VCS Integration: If your project is under version control (e.g., Git), ensure all changes are committed and push to the remote repository after renaming.
- Environment: Test the renamed project in your development and staging environments to catch possible issues before deployment.
Summary Table
| Step | Description | Tools/Commands |
| Change Directory | Rename project folder using file explorer/terminal. | mv OldProjectName NewProjectName |
| Settings Update | Open in Android Studio for indexing and error detection. | Android Studio UI |
Adjust settings.gradle | Update the rootProject.name. | Modify settings.gradle file |
Adjust build.gradle | Verify/update the applicationId if necessary. | Modify build.gradle file |
| File Update | Check XML and source for outdated references. | Edit files in Android Studio |
| Package Refactor | Optional: Change package name if needed. | Use Refactor Tool in Android Studio |
| Synchronize | Gradle sync and clean build. | ./gradlew clean build |
Additional Topics
Importance of Naming Conventions
Renaming should respect established conventions to maintain code readability and prevent naming conflicts. Naming decisions impact maintenance, especially in collaborative settings.
Potential Impact on Existing Integrations
Changing a project name can affect integrations (e.g., Firebase, third-party APIs) especially if they rely on identifiers linked to the old name.
User Impact
Consider the user-facing implications if the app is live; a name change may require user communication, data migration strategies, or updated app store listings.
By following these guidelines carefully, you can ensure a seamless transition when changing your project name in Android Studio, minimizing disruptions and maintaining application integrity.

