0

Can’t install because provider name com.facebook.app.FacebookContentProviderundefined (in package io.ionic.sxxxx) is already used by io.ionic.yyyyy]"

This is listed in a few android manifest files

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

on build I get

<provider
        android:name="com.facebook.FacebookContentProvider"
        android:authorities="com.facebook.app.FacebookContentProviderundefined"
        android:exported="true" />

— notice the undefined ----- should I be defining something somewhere? Is there another solution? Basically I have a pair of apps that will not install at the same time on a device because this output is the same. My understanding is undefined should be my facebook id. I do have a variety of values defined in my android strings file. I have seen a few answers from a couple years ago on here (Android Facebook content provider authority) , but the solutions do not work as the files in my android directory are different as are their contents. Any help would be much appreciated!

<string name="title_activity_main">xxxx</string>
<string name="package_name">io.ionic.xxxx</string>
<string name="custom_url_scheme">io.ionic.xxxx</string>
<string name="fb_app_id">xxxxx</string>
<string name="facebook_app_id">xxxxx</string>
<string name="fb_app_name">xxxxx</string>
<string name="fb_login_protocol_scheme">fbxxxxxx</string>
<string name="fb_auto_log_app_events_enabled">true</string>
<string name="fb_advertiser_id_collection_enabled">true</string>

I have tried deleting all of the tags from all of the android manifest files, but they are generated on build. I have tried adding a string called authority in my string.xml file. I have struggeled to figure out how to implement the solutions here, as they dont exactly align with the files in my ionic project. Android Facebook content provider authority.

NoDiced
  • 33
  • 1
  • 8

1 Answers1

1

There is an open issue about this on GitHub: https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/issues/100

Did you try the temporary solutions provided in the comments?

HCJSolutions commented on Dec 10, 2021

I found a temporary solution is add ${applicationId}

modified the platforms\android\app\src\main\AndroidManifest.xml find a node 123456789" android:exported="true" android:name="com.facebook.FacebookContentProvider" />

or

change it at plugin folder plugins\cordova-plugin-facebook-connect\plugin.xml find the line <provider android:authorities="com.facebook.app.FacebookContentProvider${applicationId}$APP_ID"

and

apren commented on Apr 24:

Another temporary solution:

Set any APP_ID, for example APP_ID = "app_package_name" After init app use code facebookConnectPlugin.setApplicationId('your_facebook_app_id')

Callan
  • 1,179
  • 1
  • 7
  • 18
  • 1
    So I was able to get this to work, but 2 things to modify for your answer. 1. In modern version of Ionic cordova plugins are loaded into the node modules folder, I do not have a plugins folder at the root in my project. node_modules/cordova-plugin-facebook-connect\plugin.xml 2. the $APP_ID was the culprit for the variable that was undefined. This should be removed after: com.facebook.app.FacebookContentProvider${applicationId} @Callen I super appreciate you brother! – NoDiced Dec 16 '22 at 22:56