更新到Android studio 2.3 Canary 3后,Gradle构建失败 [英] Gradle build failing after update to Android studio 2.3 Canary 3

查看:250
本文介绍了更新到Android studio 2.3 Canary 3后,Gradle构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将我的项目的android studio版本从2.3 Canary 2更新为2.3 Canary 3.从那时起,每次出现此错误时,gradle构建都会失败:

< blockquote>

错误:无法找到方法'org.gradle.api.tasks.Sync.getInputs()Lorg / gradle / api / internal / TaskInputsInternal;'。
这种意外错误的可能原因包括:

  • Gradle的依赖性缓存可能已损坏(有时会在网络连接超时后发生)。
    重新下载依赖项并同步项目(需要网络)
  • Gradle构建过程(守护进程)的状态可能已损坏。停止所有的Gradle守护进程可能会解决这个问题。
    停止Gradle构建过程(需要重新启动)
  • 您的项目可能使用与项目中其他插件或项目请求的Gradle版本不兼容的第三方插件。
在破坏的Gradle进程中,您也可以尝试关闭IDE,然后关闭所有Java进程。


我搜索了谷歌并没有找到类似这样的解决方案,但那些相似的方法无效。有人知道如何解决它吗?解决方案是选择使用默认的gradle wrapper(推荐) / em>选项在构建gradle面板中,如下图所示。
现在您可以使用gradle 3.2(在您的gradle-wrapper.properties中)和Android gradle:2.3.0-alpha3或beta1作为写作时间来构建





如果使用 File - > Invalidate Cache / Restart时遇到问题,请不要忘记使缓存无效


I've recently updated the android studio version of my project from 2.3 Canary 2 to 2.3 Canary 3. Since then the gradle build is failing every time with this error:

Error:Unable to find method 'org.gradle.api.tasks.Sync.getInputs()Lorg/gradle/api/internal/TaskInputsInternal;'. 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 all Java processes.

I've searched google and not found solutions like this exactly but those that are similar are not working. Does anyone know how to fix it?

解决方案

The solution is to select "Use default gradle wrapper (recommended)" option in the build gradle panel like the image below. Now you can build with gradle 3.2 (in your gradle-wrapper.properties) and android gradle:2.3.0-alpha3 or beta1 as the time of writing

Don't forget to invalidate cache if you have some trouble using File -> Invalidate Cache / Restart

这篇关于更新到Android studio 2.3 Canary 3后,Gradle构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆