“最低支持的Gradle版本是4.4”错误从今天开始;没有代码改变 [英] "Minimum supported Gradle version is 4.4" error started today; no code changes

查看:2201
本文介绍了“最低支持的Gradle版本是4.4”错误从今天开始;没有代码改变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  *其中: 
构建文件'C:\dev\src\my_app_name\app\build.gradle'行:1

*出错:
发生了问题评估项目':app'。
>无法应用插件[id'com.android.application']
>最小支持的Gradle版本是4.4。当前版本是4.1。如果使用gradle包装器,请尝试编辑C:\dev\src\my_app_name\gradle\wrapper\gradle-wrapper.properties中的distributionUrl到gradle-4.4-all.zip

绝对不会进行任何代码或配置更改; Gradle构建突然开始失败。任何人都知道为什么会发生?我最好的猜测是一个插件依赖于特定版本的Gradle自动更新自己,但我不知道如何确定它是哪一个。行号表明它是 com.application.plugin 插件本身。



我知道Android Studio更新通常需要相应升级到Gradle,但我的团队中没有人更新Android Studio。并且,根据Android-Studio-Gradle 版本兼容性表,Gradle 4.1仍然可以正常运行Android Studio 3.0.1,这是我运行了一段时间。



我们最近开始使用Kotlin,而我认为这可能是问题的一部分,但完全删除与Kotlin相关的所有内容并没有帮助。



我试过删除Gradle caches / 目录,运行 ./ gradlew cleanBuildCache ,删除我们的项目的 build / 目录,杀死Gradle守护进程通过 ./ gradlew --stop ,并重新启动 - 一切都无济于事。



我也试过升级到Gradle 4.4,但在DexMergerTransform(单独的问题)中导致了CIRCULAR REFERENCENullPointerException错误,原因是entir对我不明确。我希望能够迫使我的环境现在不承担Gradle 4.4依赖关系......但我不知道是什么突然引发了这种依赖关系。

解决方案

问题原来是因为我们使用了非特定版本的插件。当插件发生变化时,新版本被下载到我们的开发环境中,并且它引入了对Gradle版本的依赖性,高于我们使用的版本。



<在我们的例子中,这是罪魁祸首:

classpath'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'



降级到Butterknife插件的8.5.1版本,消除了对Gradle 4.4的依赖。


Today, multiple developers on my team started seeing this error when they attempt to run any Gradle task.

* Where:
Build file 'C:\dev\src\my_app_name\app\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Minimum supported Gradle version is 4.4. Current version is 4.1. If using the gradle wrapper, try editing the distributionUrl in C:\dev\src\my_app_name\gradle\wrapper\gradle-wrapper.properties to gradle-4.4-all.zip

Absolutely no code or config changes were made; Gradle builds just suddenly started to fail. Anyone know why this would happen? My best guess is that a plugin with a dependency on a specific version of Gradle auto-updated itself, but I'm not sure how to figure out which one it is. The line number would suggest that it was the com.application.plugin plugin itself.

I am aware that Android Studio updates often require a corresponding upgrade to Gradle, but nobody on my team updated Android Studio. And, according to the Android-Studio-Gradle version compatibility table, Gradle 4.1 should still work fine with Android Studio 3.0.1, which is what I have been running for some time.

We recently started using Kotlin, and I thought that might be part of the problem, but completely removing everything related to Kotlin didn't help.

I have tried deleting the Gradle caches/ directory, running ./gradlew cleanBuildCache, deleting our project's build/ directories, killing Gradle daemons via ./gradlew --stop, and rebooting -- all to no avail.

I also tried upgrading to Gradle 4.4, but that resulted in a "CIRCULAR REFERENCE" NullPointerException error during DexMergerTransform (separate issue), for reasons that are entirely unclear to me. I'd like to be able to force my environment to NOT take on a Gradle 4.4 dependency right now... but I don't know what suddenly triggered this dependency.

解决方案

The problem turned out to be that we were using a non-specific version of a plugin. When a change was made to the plugin, the new version was downloaded to our dev environments, and it introduced a dependency on a version of Gradle higher than the one we were using.

In our case, this was the culprit:

classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'

Downgrading to version 8.5.1 of the Butterknife plugin eliminated the dependency on Gradle 4.4.

这篇关于“最低支持的Gradle版本是4.4”错误从今天开始;没有代码改变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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