我试图列出项目的依赖树。所以我跑了gradle dependencies
并获得了以下内容:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'Android'.
Could not resolve all files for configuration ':classpath'.
Could not find org.jetbrains.trove4j:trove4j:20160824.
Searched in the following locations:
http://maven.fabric.io/public/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
http://maven.fabric.io/public/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
https://repo.maven.apache.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
https://repo.maven.apache.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
https://dl.google.com/dl/android/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
https://dl.google.com/dl/android/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
Required by:
project : > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 > com.android.tools.lint:lint:26.0.1 > com.android.tools.lint:lint-c
hecks:26.0.1 > com.android.tools.lint:lint-api:26.0.1 > com.android.tools.external.com-intellij:intellij-core:26.0.1
我无法在互联网上找到任何帮助。但是我还在跟踪。
欢迎任何帮助;]
答案 0 :(得分:7)
当我在gradle 3.1中打开一个非常旧的项目时,这种情况发生在我身上 为了解决这个问题,我补充说:
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
对两个gradles文件(app gradle文件和项目gradle文件)
答案 1 :(得分:4)
您必须将mavenCentral()
替换为jcenter()
:
buildscript {
repositories {
//mavenCentral()
jcenter()
google()
}
答案 2 :(得分:1)
我通过更改存储库的顺序解决了这个问题
从这里:
repositories {
jcenter()
google()
}
对此:
repositories {
google()
jcenter()
}