Android dependency 冲突

仲孙信瑞
2023-12-01

记录一种可以方便查看 dependency 的方法,经常遇到各种引用冲突导致的编译不通过的错误。

直接在Teminal 里面输入 gradlew app:dependencies  回车之后等一会儿就可以查看了

+--- com.google.android.wearable:wearable:2.3.0
+--- com.google.android.gms:play-services-cast-framework:15.0.0
|    +--- com.android.support:mediarouter-v7:26.1.0
|    |    +--- com.android.support:appcompat-v7:26.1.0
|    |    |    +--- com.android.support:support-annotations:26.1.0 -> 27.0.0
|    |    |    +--- com.android.support:support-v4:26.1.0
|    |    |    |    +--- com.android.support:support-compat:26.1.0
|    |    |    |    |    +--- com.android.support:support-annotations:26.1.0 -> 27.0.0
|    |    |    |    |    \--- android.arch.lifecycle:runtime:1.0.0
|    |    |    |    |         +--- android.arch.lifecycle:common:1.0.0
|    |    |    |    |         \--- android.arch.core:common:1.0.0
|    |    |    |    +--- com.android.support:support-media-compat:26.1.0
|    |    |    |    |    +--- com.android.support:support-annotations:26.1.0 -> 27.0.0
|    |    |    |    |    \--- com.android.support:support-compat:26.1.0 (*)
|    |    |    |    +--- com.android.support:support-core-utils:26.1.0
|    |    |    |    |    +--- com.android.support:support-annotations:26.1.0 -> 27.0.0
|    |    |    |    |    \--- com.android.support:support-compat:26.1.0 (*)
|    |    |    |    +--- com.android.support:support-core-ui:26.1.0
|    |    |    |    |    +--- com.android.support:support-annotations:26.1.0 -> 27.0.0
|    |    |    |    |    \--- com.android.support:support-compat:26.1.0 (*)
|    |    |    |    \--- com.android.support:support-fragment:26.1.0
|    |    |    |         +--- com.android.support:support-compat:26.1.0 (*)
|    |    |    |         +--- com.android.support:support-core-ui:26.1.0 (*)
|    |    |    |         \--- com.android.support:support-core-utils:26.1.0 (*)
|    |    |    +--- com.android.support:support-vector-drawable:26.1.0
|    |    |    |    +--- com.android.support:support-annotations:26.1.0 -> 27.0.0
|    |    |    |    \--- com.android.support:support-compat:26.1.0 (*)
|    |    |    \--- com.android.support:animated-vector-drawable:26.1.0
|    |    |         +--- com.android.support:support-vector-drawable:26.1.0 (*)
|    |    |         \--- com.android.support:support-core-ui:26.1.0 (*)
|    |    \--- com.android.support:palette-v7:26.1.0
|    |         +--- com.android.support:support-compat:26.1.0 (*)
|    |         \--- com.android.support:support-core-utils:26.1.0 (*)
|    +--- com.android.support:recyclerview-v7:26.1.0
|    |    +--- com.android.support:support-annotations:26.1.0 -> 27.0.0
|    |    +--- com.android.support:support-compat:26.1.0 (*)
|    |    \--- com.android.support:support-core-ui:26.1.0 (*)
|    +--- com.google.android.gms:play-services-base:[15.0.0,16.0.0) -> 15.0.1
|    |    +--- com.google.android.gms:play-services-basement:[15.0.1] -> 15.0.1
|    |    |    \--- com.android.support:support-v4:26.1.0 (*)
|    |    \--- com.google.android.gms:play-services-tasks:[15.0.1] -> 15.0.1
|    |         \--- com.google.android.gms:play-services-basement:[15.0.1] -> 15.0.1 (*)
|    +--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -> 15.0.1 (*)
|    \--- com.google.android.gms:play-services-cast:[15.0.0] -> 15.0.0
|         +--- com.android.support:mediarouter-v7:26.1.0 (*)
|         +--- com.google.android.gms:play-services-base:[15.0.0,16.0.0) -> 15.0.1 (*)
|         +--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -> 15.0.1 (*)
|         +--- com.google.android.gms:play-services-flags:[15.0.0,16.0.0) -> 15.0.1
|         |    +--- com.google.android.gms:play-services-base:[15.0.1] -> 15.0.1 (*)
|         |    \--- com.google.android.gms:play-services-basement:[15.0.1] -> 15.0.1 (*)
|         \--- com.google.android.gms:play-services-tasks:[15.0.0,16.0.0) -> 15.0.1 (*)
+--- com.google.android.support:wearable:2.3.0
|    +--- com.android.support:percent:26.0.2 -> 26.1.0
|    |    \--- com.android.support:support-compat:26.1.0 (*)
|    +--- com.android.support:support-v4:26.0.2 -> 26.1.0 (*)
|    +--- com.android.support:support-annotations:26.0.2 -> 27.0.0
|    \--- com.android.support:recyclerview-v7:26.0.2 -> 26.1.0 (*)
+--- com.android.support:appcompat-v7:26.1.0 (*)
+--- com.android.support:cardview-v7:26.1.0
|    \--- com.android.support:support-annotations:26.1.0 -> 27.0.0
+--- com.android.support:mediarouter-v7:26.1.0 (*)
+--- com.android.support:leanback-v17:26.1.0
|    +--- com.android.support:support-compat:26.1.0 (*)
|    +--- com.android.support:support-core-ui:26.1.0 (*)
|    +--- com.android.support:support-media-compat:26.1.0 (*)
|    +--- com.android.support:support-fragment:26.1.0 (*)
|    \--- com.android.support:recyclerview-v7:26.1.0 (*)
+--- com.android.support:design:26.1.0
|    +--- com.android.support:support-v4:26.1.0 (*)
|    +--- com.android.support:appcompat-v7:26.1.0 (*)
|    +--- com.android.support:recyclerview-v7:26.1.0 (*)
|    \--- com.android.support:transition:26.1.0
|         +--- com.android.support:support-annotations:26.1.0 -> 27.0.0
|         \--- com.android.support:support-v4:26.1.0 (*)
+--- com.android.support:percent:26.1.0 (*)
\--- com.google.android.exoplayer:exoplayer:2.7.3
     +--- com.google.android.exoplayer:exoplayer-core:2.7.3
     |    \--- com.android.support:support-annotations:27.0.0
     +--- com.google.android.exoplayer:exoplayer-dash:2.7.3
     |    +--- com.google.android.exoplayer:exoplayer-core:2.7.3 (*)
     |    \--- com.android.support:support-annotations:27.0.0
     +--- com.google.android.exoplayer:exoplayer-hls:2.7.3
     |    +--- com.android.support:support-annotations:27.0.0
     |    \--- com.google.android.exoplayer:exoplayer-core:2.7.3 (*)
     +--- com.google.android.exoplayer:exoplayer-smoothstreaming:2.7.3
     |    +--- com.google.android.exoplayer:exoplayer-core:2.7.3 (*)
     |    \--- com.android.support:support-annotations:27.0.0
     \--- com.google.android.exoplayer:exoplayer-ui:2.7.3
          +--- com.google.android.exoplayer:exoplayer-core:2.7.3 (*)
          \--- com.android.support:support-annotations:27.0.0

上面应该可以看出来 

com.google.android.exoplayer:exoplayer:2.7.3

这个东西里面以用了 

com.android.support:support-annotations:27.0.0

跟我的build 里面配置的编译版本不一致,把它exclude 掉

 

exclude group: 'com.android.support', module: 'support-annotations'

 

 类似资料: