tccpg288
tccpg288

Reputation: 3352

Manifest Merger Failed When Trying to Update to Latest FirebaseUI

I am trying to add the latest FirebaseUI dependency to my Android project. I have Facebook login enabled in my project, and when I set up the Facebook login I was required to add my Facebook App ID in the Android manifest. Here is the dependency I added to my android project:

"com.firebaseui:firebase-ui:3.0.0"

After compiling, I received the following error:

Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute meta-data#com.facebook.sdk.ApplicationId@value value=() from AndroidManifest.xml:29:13-52
is also present at [com.firebaseui:firebase-ui-auth:3.0.0] AndroidManifest.xml:21:13-60 value=().
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:27:9-29:55 to override.

I am not sure why I am being prompted to change my Facebook App ID in order to use the latest library. I am updating so that I can take advantage of the new FirebaseUI features and Firebase Cloud Firestore as well.

Manifest

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

Upvotes: 0

Views: 706

Answers (2)

Bob Snyder
Bob Snyder

Reputation: 38289

Your post says: when I set up the Facebook login I was required to add my Facebook App ID in the Android manifest. That is not the case for firebase-ui-auth:3.1.0 and may not be for 3.0.0 either. With 3.1.0, you define the IDs as string resources, as described here, and FirebaseUI generates the needed manifest entries, which get merged into the main manifest at build time. If you are defining the constants in your manifest manually, that is likely the cause of the merge conflict.

To see the contributors to the merged manifest, open your AndroidManifest.xml file in Android Studio. Click the Merged Manifest tab at the bottom of the window. In the right pane, find and click on firebase-ui-auth:3.0.0 to see the manifest entries that are generated by FirebaseUI for merging into the composite manifest. If you see meta-data entries there that you have manually entered into your manifest, delete your entries to eliminate the merge conflict.

Upvotes: 1

MakeBugsNotWar
MakeBugsNotWar

Reputation: 122

Try following their GitHub readme, located here. I was having the same problem as well and my question got a lot of attention but unluckily none could pin point the problem. The problem lies somewhere in the gradle file where you are writing this "com.firebaseui:firebase-ui:3.0.0".

Upvotes: 1

Related Questions