Android Studio fails to generate databinding after 3.1.0 update

前端 未结 20 2919
爱一瞬间的悲伤
爱一瞬间的悲伤 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:27

    I had the same issue as @Marian Pavel where my project couldn't compile the databinding components unless I had the class thats used in databinding in the root folder.

    I fixed the issue by doing this:

    Android Studio: 3.2.1 stable

    **project build.gradle**
    classpath 'com.android.tools.build:gradle:3.2.1'
    
    **module build.gradle**
    apply plugin: 'kotlin-kapt'
    kapt "androidx.databinding:databinding-compiler:3.2.1"
    
    **gradle.properties**
    android.databinding.enableV2=false
    

提交回复
热议问题