gpt4 book ai didi

java - Gradle 同步失败 - Android Studio 2.3.1

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:34:08 26 4
gpt4 key购买 nike

我的代码在更新前运行良好。但是在我更新到2.3.1之后,它开始出现以下错误,

    Error:org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
<a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li><li>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.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

请帮忙。

最佳答案

终于找到解决办法了。

指定gradle版本。您可以在 Android Studio 的文件 > 项目结构 > 项目菜单或顶级 build.gradle 文件中为 Gradle 版本指定 Android 插件。插件版本适用于该 Android Studio 项目中构建的所有模块。以下示例将 Gradle 的 Android 插件从 build.gradle 文件设置为版本 2.3.1:

 buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
}
}

来源:enter link description here

关于java - Gradle 同步失败 - Android Studio 2.3.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43243033/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com