0

I have an app with two flavors, each with a unique application id, according to the docs this is how to install both versions of the app on the same phone. But I keep getting the package name conflict error while I try to install either of them while the other one is already installed

Flavor settings

defaultConfig {
    applicationId "com.kc.mb.vr"
    multiDexEnabled true
    minSdkVersion 19
    targetSdkVersion 26
    versionCode 14
    setProperty("archivesBaseName", "vr4.25.1")
}

flavorDimensions "default"


productFlavors {
    dev {
        versionName "4.25.1"
        applicationId "com.kc.mb.vr.dev"        
        dimension "default"

    }
    prod {
        applicationId "com.kc.mb.vr"        
        versionName "3.1.2"
        dimension "default"
    }
}

After installing, I checked with the package name viewer that shows the app with the dev flavor has a packagename + ".dev" and the one with prod has a different package name. But both of them can not be installed together.

Is there any step that I might have missed ?

sam winston
  • 162
  • 1
  • 13
  • Is it possible an app with that package name already exists on your device? Maybe with a different signature or even a different app altogether? – TheWanderer Oct 17 '18 at 17:17
  • @TheWanderer couldn't find anything like that, I will update the code to show more config – sam winston Oct 17 '18 at 17:22
  • Its an issue with the file-provider authority. https://stackoverflow.com/questions/3306639/multiple-apps-use-same-content-provider – sam winston Oct 17 '18 at 18:08

1 Answers1

0

For example,in your dev flavor,delete applicationId "com.kc.mb.vr" and add following code: applicationIdSuffix ".dev" then your dev's package name will be "com.kc.mb.vr.dev"

aolphn
  • 2,950
  • 2
  • 21
  • 30
  • Thanks, but the issue was caused by having one authority with the file provider – sam winston Oct 18 '18 at 12:04
  • Sorry,I made a mistake,my answer is really not for your problem,can you post your FileProvider's configuration or some error log when you install your second app? – aolphn Oct 18 '18 at 12:07
  • @Aolphin I fixed it. I have provided a link to my actual issue in the comment above – sam winston Oct 18 '18 at 12:31