Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execution failed for task ':app:processDebugManifest' after Android Studio 2.2 update

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:28: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 element at AndroidManifest.xml:24:9-28:75 to override


Manifest file:

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


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


    <application
        android:name="com.test.app.app.AppBaseApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        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"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <activity android:name="com.test.app.ui.activities.WelcomeActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name="com.test.engine.reader.view.test5"
            android:label="@string/app_name"
            android:theme="@style/AppTheme"></activity>

        <activity android:name="com.test.app.ui.activities.test1" />
        <activity android:name="com.test.app.ui.activities.test2" />
        <activity android:name="com.test.app.ui.activities.test3" />
        <activity android:name="com.test.app.ui.activities.test4" />
    </application>

</manifest>
like image 959
Saidur Rahman Avatar asked Sep 28 '16 09:09

Saidur Rahman


1 Answers

I agree with the other answer, however, I would like to propose another solution.

Stick with the theme determined by Facebook by removing android:theme="@android:style/Theme.Translucent.NoTitleBar" and keep using compile 'com.facebook.android:facebook-android-sdk:4+'


Manifest file:

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

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

Facebook wants to handle the themes for the webdialog spinners as stated in the changelog

Better handling of themes for webdialog spinners

Ref: https://developers.facebook.com/docs/android/change-log-4.x#4_16_0

like image 76
Sungam Avatar answered Oct 13 '22 15:10

Sungam