ClassNotFoundException: Didn't find class “android.databinding.DataBinderMapper”

后端 未结 9 1820
长发绾君心
长发绾君心 2020-12-11 14:23

I am using android\'s data binding library for views in a library project

i have added the following line in my root gradle file

classpath \'         


        
相关标签:
9条回答
  • 2020-12-11 15:16

    I had the same problem after performing the migration androdx. I tried all the above methods but not resolved. I suddenly found that I used com.android.tools.build:gradle version is 3.3. I update it to 3.5. Problem is solved.

    project build.gradle: classpath 'com.android.tools.build:gradle:3.3.0' Update to classpath 'com.android.tools.build:gradle:3.5.0' Redo the migration.

    0 讨论(0)
  • 2020-12-11 15:21

    I had the same problem, but I solved it removing

    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

    from the global build.gradle and removing

    apply plugin: 'android-apt'

    from the local build.gradle, then it worked like a charm.

    It seems it was a mixed problem with Butterknife too. Pretty weird.

    0 讨论(0)
  • 2020-12-11 15:22

    Make sure that ALL your modules that use DataBinding have it enabled. This was the reason I got that exception.

    android {
        ....
        dataBinding {
            enabled = true
        }
    }
    
    0 讨论(0)
提交回复
热议问题