Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manifest Merger tools:replace failure

I am using a library which uses its own android:theme, and therefore I receive the following error while building: Error:(55, 9) Execution failed for task ':contacit:processDebugManifest'.

Manifest merger failed : Attribute application@theme value=(@style/Theme.MainTheme) from AndroidManifest.xml:55:9 is also present at com.github.florent37:materialviewpager:1.0.3.2:11:18 value=(@style/AppTheme) Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:49:5 to override

I've modified my app's AndroidManifest.xml as follows:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.main"
    android:versionCode="19"
    android:versionName="2.5" >
...
    <application
        android:name="com.example.application.MainApplication"
        tools:replace="android:theme"
        android:allowBackup="true"
        android:icon="@drawable/logo_icon"
        android:label="@string/app_name"
        android:theme="@style/Theme.MainTheme"
        >
...

However, even though I have used the tools:replace attribute, I am still getting the same error from the Manifest merger. Any ideas why?

like image 804
Ohad Avatar asked Sep 27 '22 22:09

Ohad


1 Answers

Remove tools:replace and add tools:node="replace" to application tag. It works for me.

like image 66
Nam Vo Avatar answered Oct 07 '22 21:10

Nam Vo