gpt4 book ai didi

java - 错误 : Unsupported method: AndroidProject. getVariantNames()

转载 作者:行者123 更新时间:2023-11-29 23:17:39 28 4
gpt4 key购买 nike

我在旧版本的 Android Studio 上创建了应用程序,当我在最新版本 (3.1.3) 中打开此应用程序时,应用程序无法运行,我看到了一个错误。

ERROR: Unsupported method: AndroidProject.getVariantNames().
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-wrapper.properties 并更改了它:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

还必须将 build.gradle 更改为:

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

也许你也可以改变它

buildToolsVersion '25.0.0'

希望你能通过这些步骤解决。

关于java - 错误 : Unsupported method: AndroidProject. getVariantNames(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55050174/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com