android - 我迷失了,绝望了! Gradle 对它想要什么感到困惑;版本 1.8 还是 1.9?

标签 android gradle android-studio

我刚刚升级了 Android Studio,现在 Android Studio 提示 Gradle,说:

You are using Gradle version 1.8, which is not supported. Please use version 1.9. 

所以在 Preferences > Compiler > Gradle 下,我将 Gradle 可执行文件更改为 /usr/local/Cellar/gradle/1.8/libexec .重建后,Android Studio 再次投诉,说
Gradle version 1.8 is required. Current version is 1.9. 
If using the gradle wrapper, try editing the distributionUrl in /Applications/Android Studio.app/bin/gradle/wrapper/gradle-wrapper.properties to gradle-1.9-all.zip.

我对 Gradle 包装器一无所知,但在我的 gradle.build 中,我有这些用于 gradle 版本的行:
dependencies {
    classpath 'com.android.tools.build:gradle:0.6.+'
}

有人知道我该如何解决这个问题吗?我真的被困住了,非常绝望!欢迎所有提示!

最佳答案

切换到 gradle Android 插件版本 0.7+

dependencies {
    classpath 'com.android.tools.build:gradle:0.7.+'
}

然后你应该能够使用 gradle 1.9 版进行构建。

关于android - 我迷失了,绝望了! Gradle 对它想要什么感到困惑;版本 1.8 还是 1.9?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21088879/

相关文章:

android - 在 Android Studio 中删除项目后无法刷新 ListView

android - 使用Gradle将Unirest添加到Android Studio

android - 未能加载属性文件...不再 :(

java - 适用于 Android 的 ImageResizer 库

Android 计费 - 我应该实现 ServiceConnection 还是 IMarketBillingService

spring-boot - Spring Boot 2.3.3.Rlease与Gradle包装器v6.6.1和CircleCI-如何使CircleCI不使用Gradle v6.2.2?

android - 应用程序的多个版本:带有和不带有AD

gradle - 如何在 Gradle Kotlin DSL 中有效地填充额外的属性?

android - 版本代码/版本名称错误

android - 无法在 Mac OS 上的 Android Studio 中创建新项目