android – Gradle的依赖缓存可能已损坏

栏目: IOS · Android · 发布时间: 6年前

内容简介:翻译自:https://stackoverflow.com/questions/32472338/gradles-dependency-cache-may-be-corrupt

我已经尝试过Invalidate / Cache并重新启动

还尝试删除.gradle和gradle文件..

但这个问题仍然存在.

Error:Unable to find method

‘com.android.build.gradle.BaseExtension.getTestVariants()Lorg/gradle/api/internal/DefaultDomainObjectSet;’.

Possible causes for this unexpected error include:

  • Gradle’s
    dependency cache may be corrupt (this sometimes occurs after a network
    connection timeout.) Re-download dependencies
    and sync project (requires network)
  • The state of a Gradle
    build process (daemon) may be corrupt. Stopping all Gradle daemons may
    solve this problem. Stop Gradle build
    processes (requires restart)
  • Your project may be using a
    third-party plugin which is not compatible with the other plugins in
    the project or the version of Gradle requested by the
    project.

In the case of corrupt Gradle processes, you can

also try closing the IDE and then killing allJava processes.

有什么想法吗?

感谢您的帮助!

您需要在gradle脚本中更改gradle-wrapper.properties中的distributionUrl.这个错误可以解决.
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip

翻译自:https://stackoverflow.com/questions/32472338/gradles-dependency-cache-may-be-corrupt


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

查看所有标签

猜你喜欢:

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

架构真经

架构真经

马丁L. 阿伯特(Martin L. Abbott)、迈克尔T.费舍尔(Michael T. Fisher) / 机械工业出版社 / 2017-4 / 79

前言 感谢你对本书第2版感兴趣!作为一本入门、进修和轻量级的参考手册,本书旨在帮助工程师、架构师和管理者研发及维护可扩展的互联网产品。本书给出了一系列规则,每个规则围绕着不同的主题展开讨论。大部分的规则聚焦在技术上,少数规则涉及一些关键的思维或流程问题,每个规则对构建可扩展的产品都是至关重要的。这些规则在深度和焦点上都有所不同。有些规则是高级的,例如定义一个可以应用于几乎任何可扩展性问题的模......一起来看看 《架构真经》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

URL 编码/解码
URL 编码/解码

URL 编码/解码

SHA 加密
SHA 加密

SHA 加密工具