I recently updated to compile "com.firebaseui:firebase-ui:3.0.0"
and received the following error:
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute meta-data#com.facebook.sdk.ApplicationId@value value=(@string/facebook_app_id) from AndroidManifest.xml:29:13-52
is also present at [com.firebaseui:firebase-ui-auth:3.0.0] AndroidManifest.xml:21:13-60 value=(@string/facebook_application_id).
Suggestion: add 'tools:replace="android:value"' toelement at AndroidManifest.xml:27:9-29:55 to override.
I am not sure why I am being prompted to change the of my Facebook class where I currently have my Facebook App ID.
@troy21688 could you try removing the Facebook ID from your AndroidManifest.xml and then adding it in your string resources:
<resources>
<!-- ... -->
<string name="facebook_application_id" translatable="false">APP_ID</string>
<!-- OPTIONAL Facebook Application ID, prefixed by 'fb'. Enables Chrome Custom tabs. -->
<string name="facebook_login_protocol_scheme" translatable="false">fbAPP_ID</string>
</resources>
I am actually calling it from the String resources, it is not hardcoded if
that's what you are referring to.
On Tue, Nov 21, 2017 at 1:52 PM, Sam Stern notifications@github.com wrote:
@troy21688 https://github.com/troy21688 could you try removing the
Facebook ID from your AndroidManifest.xml and then adding it in your
string resources:
APP_ID <!-- OPTIONAL Facebook Application ID, prefixed by 'fb'. Enables Chrome Custom tabs. --> <string name="facebook_login_protocol_scheme" translatable="false">fbAPP_ID</string>—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/firebase/FirebaseUI-Android/issues/1026#issuecomment-346141670,
or mute the thread
https://github.com/notifications/unsubscribe-auth/APuF-P60HvkOWo6gXn_fbSHWPJY87Iufks5s4yoFgaJpZM4QlNVe
.
--
Troy Chuinard, CPA
Can you show your AndroidManifest.xml here?
`
package="xxxxxxx">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name="android.support.multidex.MultiDexApplication"
android:allowBackup="true"
android:icon="@drawable/xxxxxxx"
android:label="@string/xxxxxxx"
android:theme="@style/AppTheme.NoActionBar"> <!-- ADD THIS LINE -->
<activity
android:name=".SignupActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
tools:replace="android:theme" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
<meta-data
android:name="com.firebase.ui.GoogleClientId"
android:value="@string/google_client_id" />
<meta-data
android:name="com.firebase.ui.TwitterKey"
android:value="@string/twitter_app_key" />
<meta-data
android:name="com.firebase.ui.TwitterSecret"
android:value="@string/twitter_app_secret" />
<activity
android:name=".PollHostActivity"
android:label="@string/title_activity_poll"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".LoadingActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".HomeActivity"
android:screenOrientation="portrait" />
<activity
android:name=".CreateActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".NewImageActivity"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
<activity
android:name=".ProfileActivity"
android:label="@string/title_activity_profile"
android:theme="@style/AppTheme.NoActionBar"></activity>
</application>
`
@troy21688 apologies for the delayed response, Thanksgiving happened and I lost track of some things.
You can see in the AndroidManifest.xml for the auth module we already have the com.facebook.sdk.ApplicationId metadata entry:
So there's no need to put it in your AndroidManifest.xml as well, it will be merged in by the Android manifest merger. If you want to customize the value of this meta-data entry, just change the value of @string/facebook_application_id and things will work as expected.
@troy21688 is this still an issue for you?
Hi,
I am facing the same issue., I cant use both Facebook and Firebase UI together. Can anyone help me pls?
@samtstern I think this issue can be closed since the fix is simply to remove the extra meta-data.
@SUPERCILEX :+1:
I'm also facing this error too, can somebody explain that?
To fix the problem just remove the:
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
Removing the application id from meta-data did not resolve this for me. The problem for me was that Firebase UI had a value entry for facebook id. If you use firebase UI, it uses the firebase values and that is where the conflict is. The default value for the facebook id for the Firebase UI package is "CHANGE_ME". Same with the facebook protocol value. I had to find the name of those values (facebook_application_id, facebook_login_protocol_scheme) and create both of those in my Strings.xml with my correct values. If you do not use firebase UI then I don't think this fix may work for you. Here is my code on how I fixed it. Hope this helps.
AndroidManifest.xml File
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_application_id" />
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/facebook_login_protocol_scheme" />
</intent-filter>
</activity>
Strings.xml file:
<string name="facebook_application_id" translatable="false">YOUR_FB_ID</string>
<!-- Facebook Application ID, prefixed by 'fb'. Enables Chrome Custom tabs. -->
<string name="facebook_login_protocol_scheme" translatable="false">YOUR_FB_PROTOCOL_ID</string>
Just add tools:replace="android:value" on AndroidManifest like this:
<!-- Facebook API Key -->
<meta-data
tools:replace="android:value"
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
It looks like firebase is looking for the string "facebook_application_id" but I think most are named "facebook_app_id" instead. I added both of these to my strings and it fixed the issue:
<string name="facebook_app_id">APP_ID</string>
<string name="facebook_application_id">APP_ID</string>
hi bro ! a also have that error. so my slove is just change the name :
"facebook_app_id"
to ->
"facebook_application_id"
in string file , so it work. hope this help
Most helpful comment
It looks like firebase is looking for the string "facebook_application_id" but I think most are named "facebook_app_id" instead. I added both of these to my strings and it fixed the issue: