我是在旧版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.
答案 0 :(得分:1)
昨天我遇到了同样的问题,我更换了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'
希望您可以解决这些步骤。