Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manifest Merger Error - Different versions of support library

I'm adding the stepper indicator library - https://github.com/badoualy/stepper-indicator - to my project. To do so, I added jitpack to my project gradle file and the stepper-indicator library to my app gradle file. However, I'm getting the following build 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:preference-v14:25.4.0] AndroidManifest.xml:25:13-35
    is also present at [com.android.support:appcompat-v7:26.0.0-beta2] AndroidManifest.xml:28:13-41 value=(26.0.0-beta2).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:23:9-25:38 to override.

The other dependencies in my app include:

compile 'com.android.support:preference-v7:25.4.0'
compile 'com.android.support:preference-v14:25.4.0'
compile 'eu.davidea:flexible-adapter:5.0.0-rc2'
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:recyclerview-v7:25.4.0'
compile 'com.android.support:cardview-v7:25.4.0'
compile 'com.android.support:support-v4:25.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-gcm:11.0.2'
compile 'com.google.android.gms:play-services-auth:11.0.2'
compile 'com.google.android.gms:play-services-ads:11.0.2'
compile 'com.google.firebase:firebase-messaging:11.0.2'
compile 'com.google.firebase:firebase-auth:11.0.2'
compile 'com.squareup.okhttp3:okhttp:3.8.1'

Without upgrading all of the android support libraries to an alpha version, is there a solution to this problem?

like image 671
waylonion Avatar asked Jul 22 '17 01:07

waylonion


1 Answers

In build.gradle you can exclude conflicting dependencies. For example:

compile ('com.github.badoualy:stepper-indicator:1.0.7'){ 
    exclude group: 'com.android.support', module: 'appcompat-v7' 
}

To inspect dependencies, you can use Gradle toolbar in Android Studio -> application module -> tasks -> android -> androidDependencies

Update:

enter image description here

like image 167
bajicdusko Avatar answered Oct 25 '22 09:10

bajicdusko