Closed troy21688 closed 6 years ago
@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 fbAPP_ID — 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?
`<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" 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">
</activity>`
Strings.xml file: `
<!-- 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
hi bro ! I also have that error. so my slove is just to change the name : "facebook_app_id" to -> "facebook_application_id" in string file , so it work. hope this help
Great it worked like magic, but I had to replace all facebook_com_id to facebook_application_id in all the files in the project using replace in file feature on Android Studio
I recently updated to compile "com.firebaseui:firebase-ui:3.0.0"
and received the following error:
Error:Execution failed for task ':app:processDebugManifest'.
I am not sure why I am being prompted to change the of my Facebook class where I currently have my Facebook App ID.