Pravesh Negi
Pravesh Negi

Reputation: 323

cordova Manifest merger failed

when we are trying to build android using cordova phone-gap this error will occurs

:mergeDebugResources
:processDebugManifest D:\Android\ThePlug\platforms\android\AndroidManifest.xml:27:9-31 Error:
    Attribute meta-data#android.support.VERSION@value value=(25.3.1) from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:27:9-31
    is also present at [com.android.support:support-v4:26.0.0-alpha1] AndroidManifest.xml:27:9-38 value=(26.0.0-alpha1).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-27:34 to override.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
:processDebugManifest FAILED
FAILURE: Build failed with an exception.

Upvotes: 14

Views: 6942

Answers (2)

JackDev
JackDev

Reputation: 5062

I am an ionic user, and can confirm there is a issue with version 1.9.1 of the facebook4 plugin which is causing this.

There are two ways to fix this, one quick workaround, and one solution.

  1. To fix it so that you can build straight away, do the following: Add the following code to the end of the build.gradle file in platforms/android.

    configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> def requested = details.requested if (requested.group == 'com.android.support') { if (!requested.name.startsWith("multidex")) { details.useVersion '25.3.1' } } } }

  2. A better fix is by using this plugin: cordova plugin add cordova-android-support-gradle-release, which should sort out any of the dependency issues.

The issue is discussed (at length) here: https://github.com/jeduan/cordova-plugin-facebook4/issues/507

Upvotes: 19

Kenin
Kenin

Reputation: 420

Remove the facebook4 plugin and reinstall the old version 1.7.4

cordova plugin rm cordova-plugin-facebook4

cordova plugin add [email protected] --save --variable APP_ID="<myid>" --variable APP_NAME="<myname>"

It works for me.

Source

Upvotes: 12

Related Questions