1

I am using 2 product flavors. Gradle code is:

productFlavors {
    app1 {
        applicationId "com.xxx.app1"
    }
    app2 {
        applicationId "com.xxx.yyy.app2"
        versionCode 2
        versionName "1.0.1"
    }
}

and it is giving INSTALL_FAILED_CONFLICTING_PROVIDER error.

It was working before, and I could submit the app to Google Play

How can I solve that?

UPDATE: When I deleted app1 from device, I could install app2.

Burak
  • 5,706
  • 20
  • 70
  • 110

1 Answers1

2

Quoting from the Android documentation:

android:authorities

A list of one or more URI authorities that identify data offered by the content provider. Multiple authorities are listed by separating their names with a semicolon. To avoid conflicts, authority names should use a Java-style naming convention (such as com.example.provider.cartoonprovider). Typically, it's the name of the ContentProvider subclass that implements the provider

The authority, as listed in android:authorities must be unique. It's possible that both the flavors of your app are using a same value of android:authorities which could be causing this issue. Changing the manifests of the flavors to use different value of android:authorities (by using Java style naming convention) would probably fix this error.

GingerNinja23
  • 162
  • 2
  • 11
  • 2
    Or, use manifest placeholders, such as `android:authorities="${applicationId}.provider"`, if you are building with Gradle (manually or via Android Studio). – CommonsWare Jun 24 '16 at 13:14