Android Data Binding: missing DataBinderMapper class

后端 未结 5 1043
忘掉有多难
忘掉有多难 2020-12-11 07:49
java.lang.NoClassDefFoundError: android.databinding.DataBinderMapper
        at android.databinding.DataBindingUtil.(DataBindingUtil.java:31)
        a         


        
5条回答
  •  感情败类
    2020-12-11 08:01

    You should include the android-apt plugin in your build.gradle in order to generate the android.databinding.DataBinderMapper class.

    In your project build.gradle:

    dependencies {
            classpath 'com.android.tools.build:gradle:1.3.1'
            classpath 'com.android.databinding:dataBinder:1.0-rc2'
            classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
    //.... more
    }
    

    In each module build.gradle:

    apply plugin: 'com.android.application'
    apply plugin: 'com.android.databinding'
    apply plugin: 'com.neenbedankt.android-apt'
    

    More information

提交回复
热议问题