14
votes

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.

2
I am getting the same error, don't think its related to the recent ionic CLI updates, but error occurred for me once I installed UA cordova plugin.mcabe
when we remove facebook4 plugin its working properly for me.Pravesh Negi
did you try adding tools:replace before removing the plugin?mcabe
no i didn't do anythingsPravesh Negi

2 Answers

19
votes

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

12
votes

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