Error: cordova run android --device

Hello,

I’m having this issue when I run this command: cordova run android --device

BUILD FAILED

Total time: 2.284 secs
Error: /Users/ebosques/Documents/AppsIonic/IonicTuto/ionicTutorial/example1/MoneyMap/platforms/android/gradlew: Command failed with exit code 1 Erroroutput:
/Users/ebosques/Documents/AppsIonic/IonicTuto/ionicTutorial/example1/MoneyMap/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.

FAILURE: Build failed with an exception.

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

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Can someone help me with this? Thanks! :grinning:

SOLVED!!!

Looking for a solution I have found a solution that worked for me and I would like to share it with you, maybe could help you like me.

Add the following code at the end of app module build.gradle file

Path:
/Ionic_appFolder/platform/android/build.gradle

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.0'
            }
        }
    }
}
1 Like