android - Gradle 构建失败,新的 Gradle 3.0.0 和 Android Studio 3``

标签 android maven gradle android-gradle-plugin

因此,我尝试使用新版本 3 的 Android Studio 从头开始​​一个新项目。一切正常,直到它尝试构建项目。然后我收到此错误消息:

Error:Unable to find method 'org.gradle.tooling.model.gradle.GradleBuild.getIncludedBuilds()Lorg/gradle/tooling/model/DomainObjectSet;'.
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 3(resp.3.0.1)安装到旧版本的同一文件夹中,就会发生这种情况。

只需重命名(或删除)旧文件夹,然后解压并重新安装。

关于android - Gradle 构建失败,新的 Gradle 3.0.0 和 Android Studio 3``,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44068642/

相关文章:

android - Android onTouchEvent MotionEvent 中的坐标是如何基于的?

java - ContainerProvider 的独立 Java Websocket 客户端 NoClassDefFoundError

java - Jackson2 objectmapper 未将请求映射到对象

在使用 1.6 jdk 编译的项目中运行 jdk 1.7 编译的 jarfile 时出现 java.lang.NoClassDefFoundError

java - android项目中不同的kotlin版本

android - ListFragment onCreate 调用了两次

java - 当我的应用程序崩溃时,如何向我发送错误数据?

Android Gradle 在 APK META-INF/license.txt 中复制的重复文件

java - Android-Studio:调试JNI时缺少Java日志

java - Java 三角函数