Unsupported method: AndroidProject.getVariantNames() in Android Studio 3.4

Finally I found out how to make things work again.

Try change to use distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip in gradle-wrapper.properties

And classpath 'com.android.tools.build:gradle:3.2.1' in build.gradle (project level).


Got the same error message after upgrading to Android Studio 3.3 and reloading an older project which was using an earlier version of Gradle. I fixed my project by changing the following line in the existing project level gradle.build file

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

In addition I had also removed some older SDKs and needed to set a Project level SDK in 'Open Module Settings'.

After these two changes the messages changed and included some auto fix links which got my project back up and running as usual.

ERROR: Minimum supported Gradle version is 4.10.1. Current version is 4.4.

Please fix the project's Gradle settings.

Fix Gradle wrapper and re-import project Gradle settings


This problem arose after installing new Android Studio 3.3.

I installed Android 8.1 (Oreo) from Tools -> SDK Manager or File -> Settings -> Appearance & Behaviour -> System Settings -> Android SDK and the project successfully sync and build.


You need to disable this setting in Android Studio:

File > Settings(or Preferences for previous versions) > Experimental > Only sync active variant