作者:vkvi 来源:ITPOW(原创) 日期:2020-4-16

Android Studio 打开一个项目,提示:ERROR: Unsupported method: AndroidProject.getVariantNames().

在 File->Sync Project with Gradle Files 时:

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.

Make Project 时提示:

Failed to install the following Android SDK packages as some licences have not been accepted.
   platforms;android-28 Android SDK Platform 28
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see

这下大概明白了,就是对应版本的 SDK 不存在,然后由于 licences 原因,也无法安装上(很奇怪,这东西要 licences 干嘛)。


我没有装 SDK Manager,于是我把 Android Studio 升级了,由 3.3(也可能是 3.4,记不得了) 升级到 3.6.2,然后打开提示升级 Gradle 等,一路升级,然后就 OK 了。