Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding room dependency gives manifest merge error

After adding

compile "android.arch.persistence.room:runtime:1.0.0-rc1" 

to my gradle file, I am getting below. Any clue how this can be fixed? I tried adding tools:replace="android:value" but it crash my app.

Error:Execution failed for task ':app:processStagingDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.2) from [com.android.support:design:26.0.2] AndroidManifest.xml:28:13-35
    is also present at [com.android.support:support-core-utils:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
like image 282
Zahid Rasheed Avatar asked Oct 20 '17 12:10

Zahid Rasheed


People also ask

How do I fix manifest merger failed?

Some Useful Tricks to Solve Merge ErrorsAdd the overrideLibrary attribute to the <uses-sdk> tag. This may be useful when we try to import a library with a minSdkVersion value that is higher than the manifest file and an error occurs. The overrideLibrary tag lets the merger tool ignore this conflict.

What is merged manifest?

The manifest merger tool combines all XML elements from each file by following some merge heuristics and by obeying merge preferences that you have defined with special XML attributes. This page describes how manifest merging works and how you can apply merge preferences to resolve merge conflicts.

How do I fix manifest merger failed apps targeting Android 12?

If you got this messages from your android studio, in your main activity add in android:exported=”false” or android:exported=”true” will solved this issue.

How do you find a merged manifest?

You can check the merged Manifest file preview in Android Studio by navigating to AndroidManifest. xml file and then Merged Manifest Viewer at the bottom of the editor.


1 Answers

Just use the version 26.1.0 of the support libraries.

compile 'com.android.support:support-core-utils:26.1.0'
compile 'com.android.support:design:26.1.0'
//...
like image 126
Gabriele Mariotti Avatar answered Sep 27 '22 01:09

Gabriele Mariotti