如何查找第三方库(Gradle引用)的依赖?

栏目: 编程工具 · 发布时间: 5年前

内容简介:可以直接执行执行结果将在控制台直接输出.可以在控制台直接查看, 但是如果依赖很多的时候, 控制无法完全显示.执行以下命令可将结果保存至文件:

答: 三种方法查找.

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

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

如何查找第三方库(Gradle引用)的依赖?

如何查找第三方库(Gradle引用)的依赖?

3. 使用网站查询 mvnrepository

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

比如我们搜索 Retrofit 的依赖:

如何查找第三方库(Gradle引用)的依赖?

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

如何查找第三方库(Gradle引用)的依赖?

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

如何查找第三方库(Gradle引用)的依赖?

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

如何查找第三方库(Gradle引用)的依赖?

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


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Practical Algorithms for Programmers

Practical Algorithms for Programmers

Andrew Binstock、John Rex / Addison-Wesley Professional / 1995-06-29 / USD 39.99

Most algorithm books today are either academic textbooks or rehashes of the same tired set of algorithms. Practical Algorithms for Programmers is the first book to give complete code implementations o......一起来看看 《Practical Algorithms for Programmers》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换