2

I changed the package name of android application recently.

The package name of the changed project is correct.

I used this approach for package name changing.

I made sure the package-name change is the recent one in Manifest.

But while launching the application it uses old package name other than that everything is ok.

I tired restarting the android studio and my machine.Nothing works.

Here is the error message I got

Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.test.old/com1.test1.new.LoginActivity } Error type 3 Error: Activity class {com.test.old/com1.test1.new.LoginActivity} does not exist.

Community
  • 1
  • 1
Durai Amuthan.H
  • 31,670
  • 10
  • 160
  • 241

1 Answers1

7

I set the new package name as value to applicationId key in the build.gradle and it solved my problem

Build.gradle

 defaultConfig {
        applicationId "com1.test1.new"
        minSdkVersion 14
        targetSdkVersion 22
    }
Durai Amuthan.H
  • 31,670
  • 10
  • 160
  • 241
  • 1
    I did not have the applicationId set in the build.gradle, so I am assuming that Android Studio was using a default. But setting the value fixed as stated in this answer. – James A Wilson Jun 25 '17 at 14:48