答: 三种方法查找.

1. 执行 Gradle Task : androidDependencies

可以直接执行

gradle androidDependencies

执行结果将在控制台直接输出.可以在控制台直接查看, 但是如果依赖很多的时候, 控制无法完全显示.

执行以下命令可将结果保存至文件:

 gradle androidDependencies > dep.txt

执行结果如下:

publishNonDefault is deprecated and has no effect anymore. All variants are now published.
:app:androidDependencies
:core:androidDependencies
:net:androidDependencies
:utils:androidDependencies
debug
debug
debug
debugCompileClasspath - Dependencies for compilation
+--- com.j256.ormlite:ormlite-android:4.48@jar
+--- com.j256.ormlite:ormlite-core:4.48@jar
debugCompileClasspath - Dependencies for compilation
+--- com.ainemo:json-gson:1.1-SNAPSHOT@jar
+--- com.squareup.okhttp3:logging-interceptor:3.11.0@jar
//以下内容省略
2. 使用Android Studio插件 : Gradle View

Gradle View是一个查询依赖的插件, 就是将上述的结果分类,方便查看, 在Android Studio 中可直接安装此插件.

执行结果如下:

Project Dependencies
  -> Dependency List
  -> Dependency Hierarchy

第一个子项为项目的直接依赖,第二项包含直接依赖的依赖.

3. 使用网站查询 mvnrepository

mvnrepository 是一个Maven 查询网站, 可以查询依赖库的各个版本以及引用依赖.

比如我们搜索 Retrofit 的依赖:

搜索结果包含了和Retrofit 相关的库, 我们点击第一个进入详细页面:

详情页面可以看各个版本, 我们点击一个版本进入版本详情页面.

这里包含依赖库的基本信息, 以及各种引用方式. 继续往下滚动:

这里包含了该库该版本的各种类别的依赖.