Install Shows Error in Console: Install Failed Conflicting Provider

Install shows error in console: INSTALL FAILED CONFLICTING PROVIDER

The authority, as listed in android:authorities must be unique. Quoting the documentation for this attribute:

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

Installation failed with message INSTALL_FAILED_CONFLICTING_PROVIDER

The fix is to make sure that defaultConfig.applicationId is defined in android section of the build.gradle file for each project using your library

           android {
defaultConfig.applicationId = "com.company.appname"(Your application package name)
}

And other thing please uninstall Settings --> Application --> --> Uninstall

INSTALL_FAILED_CONFLICTING_PROVIDER in Android


The android :authorities value is the package name.

In this case, it happens to be the package name. It simply has to be unique.

The android:name is the name of the class of that provider

Correct.

If I change the package name, to another one different than the com.google etx, and rename all the references/ imports of that package, should the problem go away?

The package name has nothing to do with it. You may need to change that as well, though, for your app to be able to be installed alongside the regular, un-modified app.

You need to have a unique value for android:authorities, and the code in your app that uses this ContentProvider needs to use an appropriate Uri (content://whatever.you.change.the.authority.to/...).



Related Topics



Leave a reply



Submit