Install shows error in console: INSTALL FAILED CONFLICTING PROVIDER
I am experimenting with the NotesList sample program in the Android SDK. I've made a slight variation in the program, but when I install my edited version I keep getting the message INSTALL_FAILED_CONFLICTING_PROVIDER in the console when I try to install it when the original notes program is already on the device. What do I need to change in the Provider to make it a unique database? It works fine if I uninstall the original notes program and then install my edited version.
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
If you have different flavors and you want to avoid collisions in the authority name you can add an applicationIdSuffix
to build types and use the resulting applicationId
in your manifest, like this:
<...
android:authorities="${applicationId}.contentprovider"/>
This can also happen when you have an older version of your app installed and made changes to the (support) library or the manifest file. Deleting the old applications from your device (Settings --> Application --> <your application> --> Uninstall
) will solve the issue then.