我有
compile 'com.facebook.android:facebook-android-sdk:4.16.0'
我的清单:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
...
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AutoTheme"
tools:replace="android:theme">
如何解决编译错误:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute activity#com.facebook.FacebookActivity@theme value=(@android:style/Theme.Translucent.NoTitleBar) from AndroidManifest.xml:69: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:66:9-70:47 to override.
tools:replace="android:theme"
或删除android:theme="@android:style/Theme.Translucent.NoTitleBar"
。这两种方法都适用于我。但哪种方法更好呢?当前的Facebook Android SDK版本是4.16.1,问题是由于[com.facebook.android:facebook-android;sdk:4.16.1]也具有android:theme="@android:style/Theme.Translucent.NoTitleBar"
,导致清单合并失败。我认为删除android:theme="@android:style/Theme.Translucent.NoTitleBar"
更好。 - kimbaudi