Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manifest merger failed : Attribute application@theme

I am trying to use this ProgressWheel librery, but I am facing this error after run the proyect.

Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute application@theme value=(@style/AppTheme) from AndroidManifest.xml:11:9-40 is also present at [com.github.Todd-Davies:ProgressWheel:1.2] AndroidManifest.xml:13:9-56 value=(@android:style/Theme.NoTitleBar). Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:5:5-23:19 to override.

This is my manifest

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

    <application
        android:name=".di.App"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".ui.activities.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <meta-data
            android:name="io.fabric.ApiKey"
            android:value="xxxxxxxxxxxxxxx"
            />
    </application>
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>

and my style.xml

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

</resources>

Any idea about how to solve it?

like image 334
JoCuTo Avatar asked Dec 23 '16 13:12

JoCuTo


People also ask

How do I fix manifest merger failed?

Try adding the following labels to resolve the issue: Add the xmlns:tools line in the manifest tag. Add tools:replace= or tools:ignore= in the application tag.

How do you do merged manifest?

Inspect the merged manifest and find conflicts Even before you build your app, you can see a preview of what your merged manifest looks by opening your AndroidManifest. xml file in Android Studio, and then clicking the Merged Manifest tab at the bottom of the editor.


2 Answers

Any idea about how to solve it?

Follow the instructions that were given to you in the error message:

Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:5:5-23:19 to override.

In other words, add tools:replace="android:theme" to your <application> element.

Or, switch to a different library.

like image 165
CommonsWare Avatar answered Oct 04 '22 07:10

CommonsWare


https://github.com/sawankumarbundelkhandi/edge_detection/issues/12#issuecomment-669854455

After a lot of searching, I found this solution working, actually, he did the same as the other told to add

Add these two lines android:theme="@style/AppTheme" and tools:replace="android:theme" to the application tag

Also, add this line xmlns:tools="http://schemas.android.com/tools" to the root manifest tag too

Here is the full code


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.doitcare.app"
    xmlns:tools="http://schemas.android.com/tools">
    <application
        tools:replace="android:theme"
        android:theme="@style/AppTheme"
        ...>
        <activity
            ...
        </activity>
    </application>
</manifest>

like image 35
Pin Mc Avatar answered Oct 04 '22 05:10

Pin Mc