Manifest Merger Error - Different versions of supp

2019-02-21 22:57发布

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?

1条回答
Summer. ? 凉城
2楼-- · 2019-02-21 23:54

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

查看更多
登录 后发表回答