Android Studio 3.0生成平面依赖关系树,因此我该如何阅读它

时间:2017-11-07 11:19:30

标签: android android-gradle

Android Studio 3.0生成平面依赖关系树。那么我怎样才能弄清楚哪个依赖项具有我正在寻找的传递依赖?

例如,在我的依赖项中某处支持lib 25.3.1存在传递依赖。执行androidDependencies任务我发现有些库正在使用customtabs:25.3.1,但我无法弄清楚哪一个因为我的依赖树看起来像这样:

alphaDebug
alphaDebugCompileClasspath - Dependencies for compilation
+--- com.android.support:multidex:1.0.2@aar
+--- :NyheterCore:lib (variant: debug)
+--- /Users/oleg/Projects/AndroidStudio/Innocode/apps/nyheter-app/NyheterCore/lib/libs/ExpiringMap.jar
+--- com.android.databinding:adapters:1.3.1@aar
+--- com.android.databinding:library:1.3.1@aar
+--- com.android.databinding:baseLibrary:3.0.0@jar
+--- :SwipeToCloseActivity:swipetoclose (variant: debug)
+--- :MediaStorage:lib (variant: debug)
+--- :Skeleton:skeletonlib (variant: debug)
+--- :UtilsLib:lib (variant: debug)
+--- :MediaChooser:lib (variant: debug)
+--- com.trello:rxlifecycle-components:0.6.1@aar
+--- com.android.support:design:26.0.1@aar
+--- com.android.support:appcompat-v7:26.0.1@aar
+--- com.android.support:recyclerview-v7:26.0.1@aar
+--- com.google.android.gms:play-services-ads:11.4.2@aar
+--- com.google.firebase:firebase-messaging:11.4.2@aar
+--- com.google.android.gms:play-services-maps:11.4.2@aar
+--- com.google.android.gms:play-services-ads-lite:11.4.2@aar
+--- com.google.android.gms:play-services-gass:11.4.2@aar
+--- com.google.firebase:firebase-core:11.4.2@aar
+--- com.google.firebase:firebase-analytics:11.4.2@aar
+--- com.google.firebase:firebase-analytics-impl:11.4.2@aar
+--- com.google.firebase:firebase-iid:11.4.2@aar
+--- com.google.firebase:firebase-common:11.4.2@aar
+--- com.google.android.gms:play-services-location:11.4.2@aar
+--- com.google.android.gms:play-services-analytics:11.4.2@aar
+--- com.google.android.gms:play-services-tagmanager-v4-impl:11.4.2@aar
+--- com.google.android.gms:play-services-analytics-impl:11.4.2@aar
+--- com.google.android.gms:play-services-base:11.4.2@aar
+--- com.google.android.gms:play-services-tasks:11.4.2@aar
+--- com.google.android.gms:play-services-basement:11.4.2@aar
+--- com.android.support:transition:26.0.1@aar
+--- com.android.support:support-v4:26.0.1@aar
+--- com.android.support:support-fragment:26.0.1@aar
+--- com.android.support:animated-vector-drawable:26.0.1@aar
+--- com.android.support:support-core-ui:26.0.1@aar
+--- net.openid:appauth:0.7.0@aar
+--- com.android.support:customtabs:25.3.1@aar
+--- com.trello:rxlifecycle:0.6.1@aar
+--- com.jakewharton.rxbinding:rxbinding:0.4.0@aar
+--- com.android.support:support-media-compat:26.0.1@aar
+--- com.android.support:support-core-utils:26.0.1@aar
+--- com.android.support:support-vector-drawable:26.0.1@aar
+--- com.android.support:support-compat:26.0.1@aar
+--- com.android.support:support-annotations:26.0.1@jar
+--- com.crashlytics.sdk.android:crashlytics:2.6.2@aar
+--- com.squareup:otto:1.3.8@jar
+--- com.squareup.retrofit2:converter-gson:2.3.0@jar
+--- com.github.tony19:timber-loggly:1.0.1@jar
+--- com.github.tony19:loggly-client:1.0.3@jar
+--- com.squareup.retrofit:retrofit:1.9.0@jar
+--- com.google.code.gson:gson:2.8.1@jar
+--- com.github.JakeWharton:ViewPagerIndicator:2.4.1@aar
+--- :cxense-insight-2.0.2:@aar
+--- :cxense-content-1.0.1:@aar
+--- com.google.dagger:dagger:2.11@jar
+--- javax.annotation:jsr250-api:1.0@jar
+--- junit:junit:4.12@jar
+--- com.squareup.retrofit2:adapter-rxjava:2.3.0@jar
+--- com.squareup.retrofit2:retrofit:2.3.0@jar
+--- com.squareup.okhttp3:logging-interceptor:3.8.1@jar
+--- io.reactivex:rxandroid:1.2.1@aar
+--- io.reactivex:rxjava:1.3.0@jar
+--- com.nostra13.universalimageloader:universal-image-loader:1.9.4@jar
+--- no.schibstedpayment:SPiD-Android:1.3.10@aar
+--- org.jetbrains.kotlin:kotlin-stdlib:1.1.4-3@jar
+--- com.android.support.test.espresso:espresso-idling-resource:2.2.2@aar
+--- com.android.support.constraint:constraint-layout:1.0.2@aar
+--- com.crashlytics.sdk.android:crashlytics-core:2.3.11@aar
+--- com.crashlytics.sdk.android:answers:1.3.9@aar
+--- com.crashlytics.sdk.android:beta:1.2.2@aar
+--- io.fabric.sdk.android:fabric:1.3.13@aar
+--- com.google.android.gms:play-services-ads-license:11.4.2@aar
+--- com.google.firebase:firebase-messaging-license:11.4.2@aar
+--- javax.inject:javax.inject:1@jar
+--- org.hamcrest:hamcrest-core:1.3@jar
+--- com.squareup.picasso:picasso:2.5.2@jar
+--- com.mcxiaoke.volley:library:1.0.19@jar
+--- com.squareup.okhttp3:okhttp:3.8.1@jar
+--- com.google.android.gms:play-services-maps-license:11.4.2@aar
+--- org.jetbrains:annotations:13.0@jar
+--- com.android.support.constraint:constraint-layout-solver:1.0.2@jar
+--- com.google.android.gms:play-services-ads-lite-license:11.4.2@aar
+--- com.google.android.gms:play-services-basement-license:11.4.2@aar
+--- com.google.android.gms:play-services-gass-license:11.4.2@aar
+--- com.google.firebase:firebase-analytics-license:11.4.2@aar
+--- com.google.firebase:firebase-iid-license:11.4.2@aar
+--- com.google.firebase:firebase-common-license:11.4.2@aar
+--- com.google.android.gms:play-services-location-license:11.4.2@aar
+--- com.jakewharton.timber:timber:2.5.1@jar
+--- com.google.android.gms:play-services-base-license:11.4.2@aar
+--- com.google.firebase:firebase-analytics-impl-license:11.4.2@aar
+--- com.google.android.gms:play-services-tasks-license:11.4.2@aar
+--- com.google.android.gms:play-services-analytics-license:11.4.2@aar
+--- com.google.android.gms:play-services-analytics-impl-license:11.4.2@aar
+--- com.google.android.gms:play-services-tagmanager-v4-impl-license:11.4.2@aar
\--- com.squareup.okio:okio:1.13.0@jar

5 个答案:

答案 0 :(得分:4)

我遇到了同样的问题,非常令人沮丧。我发现唯一的解决方案是从外部终端运行gradle dependenciesgradle dependencyInsight。例如:

./gradlew :your-module-name:dependencies

或者,如果您知道要查看哪个依赖项,例如:

./gradlew :your-module-name:dependencyInsight --configuration=alphaDebugCompileClasspath --dependency=customtabs

希望它有所帮助!

答案 1 :(得分:0)

尝试使用此命令:

./gradlew -q dependencies mymodulename:dependencies

这应该显示依赖关系树

答案 2 :(得分:0)

gradlew app:dependencies为我工作(在android studio的终端窗格中)。 命令前没有“ ./”。

答案 3 :(得分:0)

./gradlew app:androidDependencies生成平面依赖项

./gradlew app:dependencies会生成树,因此请使用此树。

答案 4 :(得分:-2)

更新到Android Studio 3.1修复了问题