如何在Android Studio中查找Gradle获取依赖项的位置?

nlejzf6q  于 2023-05-27  发布在  Android
关注(0)|答案(1)|浏览(284)

当我运行gradle任务myApp:androidDependencies时,我得到以下内容:

debugCompileClasspath - Dependencies for compilation
+--- com.serenegiant:common:4.1.1@aar
+--- androidx.databinding:databinding-runtime:7.4.2@aar
+--- androidx.databinding:databinding-adapters:7.4.2@aar
+--- androidx.databinding:databinding-common:7.4.2@jar
+--- androidx.legacy:legacy-support-v4:1.0.0@aar
+--- com.google.android.material:material:1.9.0@aar
+--- androidx.preference:preference:1.0.0@aar
+--- androidx.constraintlayout:constraintlayout:2.0.1@aar
+--- androidx.appcompat:appcompat:1.6.1@aar
+--- androidx.appcompat:appcompat:1.6.1@aar
...

有没有一种方法可以准确地找出这些依赖项来自哪个存储库?这个问题与another question of mine有关。依赖项com.serenegiant:common:4.1.1在此项目中工作正常,但在另一个无法找到它的项目中无法工作。失败,并出现以下错误:

Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.serenegiant:common:4.1.1.
Searched in the following locations:
  - https://dl.google.com/dl/android/maven2/com/serenegiant/common/4.1.1/common-4.1.1.pom
  - https://repo.maven.apache.org/maven2/com/serenegiant/common/4.1.1/common-4.1.1.pom
  - https://jitpack.io/com/serenegiant/common/4.1.1/common-4.1.1.pom

任何提示将不胜感激。

vvppvyoh

vvppvyoh1#

正如我在github上看到的,这个库是作为.aar发布的,而不是发布到其他仓库https://github.com/duvitech/libcommon/tree/master/repository/com/serenegiant/common,那么你必须下载.aar文件并将其作为库模块导入。查看如何将AAR添加到项目中

相关问题