Android - package conflicts with existing package with the same name

I set this default configuration to Gradle.

defaultConfig { applicationId "com.my.application" minSdkVersion 16 targetSdkVersion 22 versionCode 190011 versionName "2.2.1" } 

And these flavors

 productFlavors { dev { applicationIdSuffix ".dev" versionCode 333333 buildConfigField "String", "ANVIL_BASE_URL", "DEBUG_URL" resValue "string", "app_name", "app name dev" signingConfig signingConfigs.releasesign } prod { buildConfigField "String", "ANVIL_BASE_URL", "PROD_URL" resValue "string", "app_name", "app name" signingConfig signingConfigs.releasesign } } 

I got an application released on the Play Store with the default application identifier "com.my.application", but when I have the Play Store version installed and you want to install the "dev" application, it displays a message that says the following:

 app name dev App not installed The package conflicts with an existing package by the same name 

Am I doing something wrong? I tried changing the buildCode for dev, but that didn't work either.

Any guess?

Thanks in advance.

+5
source share
3 answers

Well, trying to install a modified version of the application through the command line, I found the following error:

 adb install ~/Desktop/app-dev-release.apk Failed to install /Users/axier/Desktop/app-dev-release.apk: Failure [INSTALL_FAILED_DUPLICATE_PERMISSION: Package com.my.application.dev attempting to redeclare permission com.my.application.permission.C2D_MESSAGE already owned by com.my.application] 

So, I modified my AndroidManifest.xml file as follows:

 <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" /> 

Pretty bad error description for this. Hope the solution will work for someone like me in the future.

Thank you anyway.

+4
source

You should look at the gradle documentation (ApplicationId versus PackageName) . Also, have you really released a version in the play store with the package name "com.my.application"? My suggestion for your problem was to put the application in ProductFlavors. Also consider fooobar.com/questions/1257056 / ... which also answers your question.

0
source

You have installed the application on your phone with the same package name. Install int before installing this.

0
source

All Articles