I'm getting
Warning: library class android.databinding.DataBindingUtil depends on program class android.databinding.DataBindingComponent
I get this when attempting to run the gradle task assembleItestAndroidTest
after introducing data binding to my project. (I have a separate build config for instrumentation testing which I call itest
, the other two being debug and release)
How to fix this?
edit: I think this is a android-gradle build tool bug or Android Data Binding bug. I've filed a bug report to Google with full instructions on how to reproduce.
The key here is that the build type is configured to run minification. So any build type other than debug
for the instrumentation test will fail as long as you rely on data binding.
This is pretty much a show-stopper for any company having continous integration as an integral part of their production cycle so I hope Google prioritize this high.
Instrumented tests are tests that run on physical devices and emulators, and they can take advantage of the Android framework APIs and supporting APIs, such as AndroidX Test.
The Data Binding Library is a support library that allows you to bind UI components in your layouts to data sources in your app using a declarative format rather than programmatically. Layouts are often defined in activities with code that calls UI framework methods.
Try adding the following to your proguard config:
-dontwarn android.databinding.**
-keep class <whatever your package name in AndroidManifest is>.databinding.** {
<fields>;
<methods>;
}
The first line gets rid of the warning, and the second tells proguard to not mess with any of the generated classes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With