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 \'
classpath 'com.android.databinding:dataBinder:1.0-rc1'
apply plugin: 'com.android.databinding'
Remove that lib. from gradle.
Best guess. Get rid of android-apt
And if there are libraries using apt
Instead of apt 'lt.mdm.sdd:myLib:1.5.1'
use
annotationProcessor 'lt.mdm.sdd:myLib:1.5.1'
.
I'm not sure if this will help you, and i have no idea if library it self should be changed.
It helped me (i was using androidannotations.org
older version with apt) at least.
Update
And i have no idea why you apply plugin: 'com.android.databinding'
? It works without it as well.
Get inspiration from @Bolein95 say.Because it depend on a library that does not support androidx(no setting databinding=true),Written by a colleague who has left.I copy a few necessary files from his github repo, it work!
Besides adding the following to build.gradle
:
android {
dataBinding {
enabled = true
}
}
I also have to add the following dependency:
dependencies {
kapt 'com.android.databinding:compiler:3.0.1'
}
finally i was able to solve this issue. It seems there was a conflict between apt version of the app and library modules.
upgraded the apt version in the app to
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
The new way of adding DataBinding is by adding on the build.gradle of all your modules:
android {
...
buildFeatures {
dataBinding true
}
}
Don't forget to add also the kotlin-kapt
plugin at the top:
plugins {
...
id 'kotlin-kapt'
}