androidgradle

Gradle sync failed after restarting android studio, Cannot convert string value 'ML_MODEL_BINDING'


I did 'Invalidate Caches/Restart' in Android studio and then I got this error while syncing gradle.

Cannot convert string value 'ML_MODEL_BINDING' to an enum value of type 'com.android.builder.model.AndroidGradlePluginProjectFlags$BooleanFlag' (valid case insensitive values: APPLICATION_R_CLASS_CONSTANT_IDS, TEST_R_CLASS_CONSTANT_IDS, TRANSITIVE_R_CLASS, JETPACK_COMPOSE)

I am using gradle 4.1.0-alpha05

classpath 'com.android.tools.build:gradle:4.1.0-alpha05'

I have tried clean project, rebuild project, deleted the build files and restarted Android Studio. Nothing worked

Thanks in advance


Solution

  • Had the same problem on IntelliJ 2020.1.3 .

    What worked for me was updating gradle versions to the highest available:

    in file build.gradle (project)

    dependencies {
            classpath 'com.android.tools.build:gradle:4.1.0-beta03'
    

    in file gradle-wrapper.properties

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