Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.
  • What went wrong: Execution failed for task ':processDebugManifest'.

    Manifest merger failed : Attribute meta-data#android.support.VERSION@value val ue=(25.3.1) from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:2 7:9-31 is also present at [com.android.support:support-v4:26.0.0-alpha1] Androi dManifest.xml:27:9-38 value=(26.0.0-alpha1).Suggestion: add 'tools:replace="android:value"' to element a t AndroidManifest.xml:25:5-27:34 to override.

like image 922
Pravesh Negi Avatar asked May 29 '17 06:05

Pravesh Negi


2 Answers

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

like image 87
IonicBurger Avatar answered Nov 16 '22 17:11

IonicBurger


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

like image 27
Kenin Avatar answered Nov 16 '22 17:11

Kenin