Content Provider INSTALL_FAILED_CONFLICTING_PROVIDER (installing content provider as a separate apk)

倖福魔咒の 提交于 2019-11-27 18:44:17

One solution i can think of is, make content provider part of both the applications with different packageid's internally.and export it using android:exported = true. Both might be using the same code though.

At the start of the application you check if the other content provider exists on the device if it's there you start using it,otherwise you fallback to local content provider. when the other applicaton installs it can does the same check.

To protect your cotent provider from everyone else, you can define a custom permission to protect it, so that your applications can only use it or you can also put some custom authentication like some secret key to access the content provider. you can have this authentication code in all methods of content provider.

Ali Ashraf

You can solve it by changing the value of android:authorities in your AndroidManifest.xml file. The reason for the error is that another application installed on your device already uses that same value for android:authorities.

To solve this error: Installation error: INSTALL_FAILED_CONFLICTING_PROVIDER

change the value of android:authorities in your AndroidManifest.xml file another application installed on your device already uses that same value for android:authorities.

You use one unic data like Facebook API registration numer or something like it in your manifest file (AndroidManifest.xml) for both programs: for which already installed and for that you try and cant install. You need:

  1. Try to find something like this and check is it for your current program:

android:authorities="com.facebook.app.FacebookContentProvider23473465463573466" android:name="com.facebook.FacebookContentProvider" android:exported="true"/>

  1. Check if is not dublicate in another programs if it is for program you trying to install.

It means your phone already has provider with same authorities, registered by different application(could be your other example).Change your provider authorities i.e. android:authorities and your are good to go.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!