如何解决Facebook工具:replace =“android:theme”? [英] How to solve Facebook tools:replace="android:theme"?

查看:128
本文介绍了如何解决Facebook工具:replace =“android:theme”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有

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=".YandexProvider"
            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.


推荐答案

1)添加 xmlns:在AndroidManifest上,tools =http://schemas.android.com/tools< manifest> 元素

2)添加工具:replace =android:theme to(facebook activity)< activity>

2) Add tools:replace="android:theme" to (facebook activity) <activity>

这是我的清单文件

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.company.product" xmlns:tools="http://schemas.android.com/tools">

    ...

    <application
      android:allowBackup="true"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:theme="@style/AppTheme"
      android:name="MyApplication">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
        <intent-filter>
            ...
        </intent-filter>
      </activity>

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

        ...

      </application>

</manifest>

这篇关于如何解决Facebook工具:replace =“android:theme”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆