Gradle同步失败:不支持的方法:Variant.getDesugaredMethods()。您连接到的Gradle版本不支持该方法。

4

早上遇到了这个问题,不确定接下来该怎么做。即使使用--stacktrace或--scan运行gradle,我仍然无法理解它到底想让我做什么。我该如何解决这个问题?谢谢。

Unsupported method: Variant.getDesugaredMethods().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

enter image description here


尝试在您的IDE中设置Gradle版本。进入“设置”->“构建”->“构建工具”->“Gradle”,将“构建和运行使用”更改为Gradle。将“使用Gradle来自”设置为gradle-wrapper.properties文件,并选择正确的Gradle JVM版本。 - Hans
似乎找不到“构建和运行使用”的选项。我已经更新了问题并附上了截图。 - ClarenceHD
我已经向他们的问题跟踪器 https://issuetracker.google.com/issues/232107692 报告了此事。 - Niklas
3个回答

2

将您的Android Gradle插件更新到7.3.0-alpha09版本,Gradle包装器更新到distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip


我现在遇到这个错误。我怀疑这与gradle版本无关。执行任务':app:lintVitalAnalyzeRelease'失败。
在执行com.android.build.gradle.internal.lint.AndroidLintWorkAction时发生故障 内部错误:意外的lint无效参数。
- ClarenceHD

2

0

在使用Gradle Wrapper 7.3.3和com.android.library版本7.2时,在Dolphin上遇到了这个问题。

切换到Chipmunk可解决该问题。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接