Android Studio fails to generate databinding after 3.1.0 update

前端 未结 20 2958
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-15 02:40

This morning I made an update to android studio from 3.0.1 to 3.1.0. After updating the gradle to latest version I still get build error regarding

20条回答
  •  生来不讨喜
    2020-12-15 03:26

    Following the update to Android Studio 3.2, this line works for me. I have both Java and Kotlin code (compiler) running in my project.

    Add the following to your gradle.properties: android.databinding.enableV2=false

    Reason:

    Data Binding V2

    Data Binding V2 is now enabled by default and is compatible with V1. This means that, if you have library dependencies that you compiled with V1, you can use them with projects using Data Binding V2. However, note that projects using V1 cannot consume dependencies that were compiled with V2.

    source (Release Note): https://developer.android.com/studio/releases/

提交回复
热议问题