How to change Pakage name in Android studio

⏱️ Reading Time: 1 minute | 📝 Word Count: 157

Changing Package Name in Android Studio

There are 2 steps to properly change the package name:


Step 1: Refactor the Package Name

  1. In the Project panel, switch view to Android
  2. Expand app → java
  3. Right-click on your package name (e.g., com.example.myapp)
  4. Select Refactor → Rename
  5. A dialog will appear — click “Rename Package”
  6. Type your new package name
  7. Click Refactor and then Do Refactor

Step 2: Update in AndroidManifest.xml

  1. Go to app → manifests → AndroidManifest.xml
  2. Find and update the package attribute:
   <manifest xmlns:android="..."
       package="com.newname.myapp">
  1. Save the file

Step 3: Update in build.gradle

  1. Go to app → build.gradle
  2. Find applicationId and update it:
   android {
       defaultConfig {
           applicationId "com.newname.myapp"
           ...
       }
   }
  1. Click “Sync Now” when prompted

Step 4: Clean & Rebuild

Go to Build → Clean Project, then Build → Rebuild Project


⚠️ Important: Make sure all three places match exactly:

  • Folder package name
  • AndroidManifest.xml
  • build.gradle (applicationId)

If they don’t match, the app will throw build errors.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top