Mike6679
Mike6679

Reputation: 6117

Android Studio 4.0.1 : Build Failed : option 'android.databinding.enableV2' is deprecated

I recently upgraded to Android Studio 4.0.1 and my build keeps failing with the message:

The option 'android.databinding.enableV2' is deprecated. The current default is 'true'. It has been removed from the current version of the Android Gradle plugin. Databinding v1 is removed.

I tried adding:

android.enableExperimentalFeatureDatabinding = false
android.databinding.enableV2=false

to gradle.properties and gradle-wrapper.properties. but neither solved the issue. Is there something that has to be added or removed from build.gradle possibly?

Upvotes: 7

Views: 7273

Answers (2)

Mike6679
Mike6679

Reputation: 6117

The issue was that the line:

android.databinding.enableV2=false

had to be removed from the gradle-properties file in my HOME directory . On a MAC it is located here:

~/.gradle

Upvotes: -2

Martin Zeitler
Martin Zeitler

Reputation: 76649

Remove these lines from gradle.properties:

android.enableExperimentalFeatureDatabinding=false
android.databinding.enableV2=false

And rather fix the reason why you've added them properly ("could not make a guess" ...). Also see if not another module might use option android.databinding.enableV2 and try to manually delete the build cache and build directories once. Updating the IDE will only update the Gradle plugin version, it certainly changes nothing else. If you should have such concerns, you probably should use some kind of version control system, which shows all changes in a diff (this also provides unlimited undo and lots of other useful features); Android Studio supports that without plugins.

Upvotes: 9

Related Questions