我是在android Studio 4.2.1上构建我的Android项目的。但是我得到了这个错误:
org.gradle.tooling.model.UnsupportedMethodException: Unsupported method:
AndroidArtifact.getBuildConfigFields().
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.我的Gradle版本:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip我的Gradle插件工具版本:
com.android.tools.build:gradle:4.1.0-alpha09Gradle和Gradle插件都是最新版本。异常表明我需要更新/更改连接的Gradle版本。
我不可能升级到更高的版本,因为我已经是最新版本了。所以,我唯一能做的就是改变成绩版本,但是是哪一个呢?
发布于 2020-06-12 00:16:10
我能够通过使用以下工具成功地构建项目:
classpath 'com.android.tools.build:gradle:4.0.0'但是如果你正在尝试使用jetpack compose,你将不得不使用最新的android studio金丝雀版本。
https://stackoverflow.com/questions/61981230
复制相似问题