2

When attempting to include the Google Play Services location library, I am getting the following error:

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value 
value=(25.4.0) from [com.android.support:design:25.4.0] 
AndroidManifest.xml:28:13-35 is also present at [com.android.support:support-v4: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.

My dependencies are as follows:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    // You must install or update the Support Repository through the SDK manager to use this dependency.
    compile 'com.android.support:support-v4:25.4.0'
    compile 'com.android.support:design:25.4.0'
    implementation "com.android.support:appcompat-v7:25.4.0"
    implementation "com.android.support:preference-v14:25.4.0"
    implementation "com.koushikdutta.ion:ion:2.+"
    implementation 'com.twilio:video-android:2.0.0-beta2'
    implementation 'com.google.android.gms:play-services-location:12.0.0'

    compile('org.simpleframework:simple-xml:2.7.+') {
        exclude module: 'stax'
        exclude module: 'stax-api'
        exclude module: 'xpp3'
    }
}

What I have already tried:

  • Changing the version of the support library. If I do this, I get a slew of errors about resources and attributes not being found.
  • Adding a resolutionStrategy as described in several posts with similar errors, like this one. That results in a similar litany of errors.
  • Updating the version of the build tools.
  • Updating the compileSdkVersion.

I feel that there must be a simple solution but I cannot seem to find it. Thanks for your time.

Dehodson
  • 449
  • 4
  • 14

2 Answers2

1

You should check your dependencies from conflicted libraries with:

./gradlew app:dependencies

where app is your module name.

Or do the following (read the details at View the dependency tree):

  • Select View > Tool Windows > Gradle (or click Gradle in the tool windows bar).
  • Expand AppName > Tasks > android and double-click androidDependencies. After Gradle executes the task, the Run window should open to display the output.

A quick check from your dependencies, the com.koushikdutta.ion:ion:2.+ is using the following in its dependencies:

compile 'com.android.support:support-v4:+'

which will get the latest version of support library. So, you need to exclude support library from it with:

implementation ("com.koushikdutta.ion:ion:2.+") {
    exclude group: 'com.android.support'
    exclude module: 'support-v4'
}

You should try avoiding using + in your dependency library version.

Make sure you are using the same version for compileSdkVersion, buildToolsVersion, targetSdkVersion, and support libraries.

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
1

Try the below mentioned code for libraries:

implementation 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:27.1.0'
compile 'com.android.support:design:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:preference-v14:27.1.0'
implementation "com.koushikdutta.ion:ion:2.+"
implementation 'com.twilio:video-android:2.0.0-beta2'
implementation 'com.google.android.gms:play-services-location:12.0.0'
compile('org.simpleframework:simple-xml:2.7.+') {
    exclude module: 'stax'
    exclude module: 'stax-api'
    exclude module: 'xpp3'
}

Also, make sure, the minSdkVersion is 16 or more as twilio library supports minSdkVersion 16 or more. And one more thing, the compileSdkVersion must be 27.

Kruti Parekh
  • 1,271
  • 9
  • 21