Android应用中的Facebook代码在同步时出错

时间:2017-08-28 09:57:21

标签: android facebook firebase

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:19:13-52
    is also present at [com.firebaseui:firebase-ui-auth:1.2.0] AndroidManifest.xml:23:13-60 value=(@string/facebook_application_id).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:17:9-20:15 to override.

的build.gradle

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    // FirebaseUI


    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-database:10.2.0'

    compile 'com.google.firebase:firebase-storage:10.2.0'
    compile 'com.google.firebase:firebase-messaging:10.2.0'
    compile 'com.google.firebase:firebase-config:10.2.0'
    compile 'com.firebaseui:firebase-ui-auth:1.2.0'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.google.android.gms:play-services-auth:10.2.0'
    compile 'com.google.firebase:firebase-auth:10.2.0'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

AndroidManifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

    package="pritish.sawant.com.simplypubliccloud">

    <uses-permission android:name="android.permission.INTERNET" />



    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_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/fb_login_protocol_scheme" />
            </intent-filter>
        </activity>
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".Image.ImageActivity" />
        <activity android:name=".Video.VideoActivity" />
        <activity android:name=".LoginSignUp.LoginActivity" />
        <activity android:name=".LoginSignUp.ResetPasswordActivity" />
        <activity android:name=".LoginSignUp.SignupActivity" />
        <activity android:name=".PhoneAuthentication.PhoneAuthenticationActivity"></activity>
    </application>

</manifest>

我缺少什么?我也在我的应用程序和Facebook登录中实现Firebase。我已经加入了网址&#39; https://maven.fabric.io/public&#39;在我的项目的build.gradle中。我已更新了我的Google存储库和Google Play服务。请帮忙。我没有从firebase中包含最新版本的库,否则我会遇到很多错误

1 个答案:

答案 0 :(得分:0)

  

建议:添加&#39;工具:replace =&#34; android:value&#34;&#39;到

您应该添加 tools:replace

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
    >

    <application
      android:allowBackup="true"
      ......
      tools:replace="allowBackup, label"
        >