9

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.

Nilzor
  • 18,082
  • 22
  • 100
  • 167
  • 1
    they had a problem with the first apha release of the build tools, try classpath 'com.android.tools.build:gradle:2.0.0-alpha2 – stoyan Dec 03 '15 at 18:39
  • Upgraded to AS 2.0 preview 2 and to that gradle build tools version but it did not help :-( – Nilzor Dec 04 '15 at 08:37

1 Answers1

1

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.

bpen42
  • 11
  • 2