如何找到android studio中使用的依赖项

时间:2017-12-26 15:39:50

标签: android gradle dependency-management

我有一个依赖项冲突显示我使用了com.google.android.gms to 9.0.0 ,我发现依赖树中使用了com.google.android.gms to 9.0.0,但我还没有在我的代码中使用它,com.google.android.gms to 9.0.0来自哪里,如何找到它在项目中使用的位置?先谢谢。

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
implementation 'io.reactivex:rxjava:1.2.0'
implementation 'io.reactivex:rxandroid:1.2.1'

implementation 'com.google.android.gms:play-services-auth:11.6.0'
}

依赖树:

releaseUnitTestCompileClasspath - Resolved configuration for compilation for variant: releaseUnitTest
+--- com.google.firebase:firebase-core:9.0.0
|    \--- com.google.firebase:firebase-analytics:9.0.0
|         +--- com.google.android.gms:play-services-basement:9.0.0 -> 11.6.0


releaseUnitTestRuntimeClasspath - Resolved configuration for runtime for variant: releaseUnitTest
+--- com.google.firebase:firebase-core:9.0.0
|    \--- com.google.firebase:firebase-analytics:9.0.0
|         +--- com.google.android.gms:play-services-basement:9.0.0 -> 11.6.0

1 个答案:

答案 0 :(得分:1)

检查项目的整个依赖关系树调用gradle dependencies --configuration compile 您必须使用另一个使用此依赖项的模块。

您可以使用

强制使用特定版本
configurations.all {
  resolutionStrategy {
    force 'com.google.android.gms:play-services-basement:11.6.0'
  }
}
or
compile('com.google.android.gms:play-services-basement:11.6.0') {
    force = true
}