【发布时间】:2018-11-07 01:35:01
【问题描述】:
我遇到了一个与 gradle 相关的问题,我不知道如何解决它......
如果我把这个命令放在我的终端上:gradle --scan :<module A>:debugCompileClasspath
这就是它向我展示的内容:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project '<root_project_file>'.
> Could not resolve all files for configuration ':classpath'.
> Could not find gradle-core.jar (com.android.tools.build:gradle-core:3.1.2).
Searched in the following locations:
https://plugins.gradle.org/m2/com/android/tools/build/gradle-core/3.1.2/gradle-core-3.1.2.jar
> Could not find layoutlib-api.jar (com.android.tools.layoutlib:layoutlib-api:26.1.2).
Searched in the following locations:
https://plugins.gradle.org/m2/com/android/tools/layoutlib/layoutlib-api/26.1.2/layoutlib-api-26.1.2.jar
我该如何解决这个问题?
P.S:我的 Gradle Android 插件是 3.1.2 和 gradle 版本:distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
P.S.2:清除 gradle 的缓存,现在这些错误消失了,但我现在遇到了这个问题...Task 'debugCompileClasspath' not found in project ':<Module_porject>'.
【问题讨论】:
-
@Eminem 现在我的问题不同了!
-
发生了什么变化?..
-
@Eminem 刚刚通过执行以下命令清除了 Gradle 的缓存:`rm -rf $HOME/.gradle/caches` 和
./gradlew cleanBuildCache -
@Eminem 我想我别无选择。我会尽量保持通知:) 谢谢