Could not find method coreLibraryDesugaringEnabled

April 20, 2020

For Android Studio 3.6.3, make sure

  • Android Gradle Plugin Version: 4.0.0-beta04
  • Gradle Version: 6.1.1

NOTE: Check gradle version at Android Studio -> File -> Project Structure -> Project

Android Gradle Plugin Version: top level / project build.gradle

buildscript {
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.0-beta04'
    }
}

Gradle Version: gradle-wrapper.properties

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

NOTE: It still show a few desugar-related related warning, perhaps need experiment with higher gradle version or use Android Studio 4.0 (currently in Beta 4)

Ocassionaly it might complain of the following error, which could be temporay resolved by Android Studio -> Build -> Rebuild Project.

com.intellij.openapi.externalSystem.model.ExternalSystemException: This version of Android Studio cannot open this project, please retry with Android Studio 4.0 or newer.

NOTE: At the end, I use Android Studio 4.0 Beta 4 due to some IDE annoyance.

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.