How to solve Facebook tools:replace=”android:theme”?

1) Add xmlns:tools="http://schemas.android.com/tools" to <manifest> element at AndroidManifest

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

Here is my manifest file

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

Leave a Comment