Home » Android » How to debug 'BUILD FAILED' in Android?

How to debug 'BUILD FAILED' in Android?

Posted by: admin June 15, 2020 Leave a comment

Questions:
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
How to&Answers:

Facebook new sdk has been released yesterday. Change your facebook sdk dependency as:

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

Answer:

My gradle line for Facebook SDK was set to

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

So it was pulling the latest SDK that came out on 28th Sept (4.16.0). This version is causing this error. To fix this we added the following lines to <application> tag in manifest file:

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

This seems to fix it.

Answer:

I hope this resolve your bug.

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

Replace To

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

Answer:

remove activity facebook from your manifest because the last update of gradle merge all activity (lib and 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"/>

or edit version to compile ‘com.facebook.android:facebook-android-sdk:4.15.0’