Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conflicting content providers facebook SDK

I have a problem with facebook SDK version 4.0.0 -> I am trying to set up two different flavors of my app - staging and production.

Everything works as fine as expected but I get INSTALL_FAILED_CONFLICTING_PROVIDER error when trying to install one app if another is already on the device.

I researched it, tried a couple of solutions but unfortunately as this is a 3rd party provider I achieved nothing.

Maybe someone encountered a similar problem and found a solution? I'll be glad for any help, links, documentations etc.

Here is how I define provider in manifests, it's exactly how facebook documentation tells this should be done

<provider android:authorities="com.facebook.app.FacebookContentProvider{staging or production fb app id depending on flavour}"
              android:name="com.facebook.FacebookContentProvider"
              android:exported="true" />
like image 231
bartol Avatar asked May 08 '15 12:05

bartol


2 Answers

You need to create two separate facebook account app id because I think you have set two different package names for your app for staging and production.

Ex. Staging app package name:com.example.app1

Production app package name:com.example.app2

So you can not use same facebook app Id for both this versions.

like image 58
Jay Shah Avatar answered Nov 04 '22 06:11

Jay Shah


I'm facing the exact same problem. This is because provider authorities needs to be unique. Try uninstalling your app from the device first (all flavours), it works for me. It looks like the two flavours cannot co-exist with the same contentprovider authority and/or package name, so if it doesn't work you could try changing one of those. Otherwise maybe you'll just have to use 2 different facebook app ids.

like image 24
agustinaliagac Avatar answered Nov 04 '22 07:11

agustinaliagac