Ionic – Android authorities: FacebookContentProvider undefined in android manifest

Issue

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.

Solution

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’)

Answered By – Callan

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published