2016-09-28 56 views
7
D:\Eon_Final_Build\EON_android\app\src\main\AndroidManifest.xml:96:13-72 Error: 
    Attribute activity#[email protected] value=(@android:style/Theme.Translucent.NoTitleBar) from AndroidManifest.xml:96:13-72 
    is also present at [com.facebook.android:facebook-android-sdk:4.16.0] AndroidManifest.xml:32:13-63 value=(@style/com_facebook_activity_theme). 
    Suggestion: add 'tools:replace="android:theme"' to <activity> element at AndroidManifest.xml:92:9-96:75 to override. 
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger. 
:app:processDebugManifest FAILED 
Error:Execution failed for task ':app:processDebugManifest'. 
Manifest merger failed : Attribute activity#[email protected] value=(@android:style/Theme.Translucent.NoTitleBar) from AndroidManifest.xml:96:13-72 
    is also present at [com.facebook.android:facebook-android-sdk:4.16.0] AndroidManifest.xml:32:13-63 value=(@style/com_facebook_activity_theme). 
    Suggestion: add 'tools:replace="android:theme"' to <activity> element at AndroidManifest.xml:92:9-96:75 to override. 
Information:BUILD FAILED 
+4

http://stackoverflow.com/help/how-to-ask – kotoj

+2

錯誤實際上告訴你如何解決它 - 「添加」工具:替換=「android:theme」'元素在AndroidManifest.xml:92:9-96:75「 –

+0

請改變你的帖子標題,目前還不清楚。 – uelordi

回答

10

Facebook新sdk已於昨天發佈。改變你的Facebook SDK的依賴性爲:

compile 'com.facebook.android:facebook-android-sdk:4.15.0' 
+1

這就是答案。謝謝。 –

+0

爲我工作,非常感謝! –

6

我對於Facebook SDK gradle這個線設置爲

compile 'com.facebook.android:facebook-android-sdk:4.+' 

於是有人拉說出來就9月28日(4.16.0)最新的SDK。此版本導致此錯誤。爲了解決這個問題,我們添加了以下行<application>標籤清單文件:

tools:node="replace" 
tools:replace="android:theme" 

這似乎解決它。

+0

這工作就像一個魅力! –

2

我希望這可以解決您的錯誤。

<activity 
       android:name="com.facebook.FacebookActivity" 
       android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" 
       android:label="@string/app_name" 
       android:theme="@android:style/Theme.Translucent.NoTitleBar" /> 

替換爲了

<activity 
      android:name="com.facebook.FacebookActivity" 
      android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" 
      android:label="@string/app_name" 
      android:theme="@style/com_facebook_activity_theme" /> 
+0

太棒了!這解決了我的問題!謝謝! – datasmurfen

0

刪除Facebook的活動從您的清單,因爲gradle這個最後更新合併所有活動(lib和SDK ...)。

<activity 
     android:name="com.facebook.FacebookActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" 
     android:label="@string/app_name" 
     android:theme="@android:style/Theme.Translucent.NoTitleBar"/> 

或編輯版本編譯 'com.facebook.android:facebook-android-sdk:4.15.0'

+0

不,您不會從Manifest中移除(整個)Facebook活動,您只需從包含/聲明FB活動的活動中移除'android:theme =「@ android:style/Theme.Translucent.NoTitleBar」'。 – croc