Android 数据绑定和 Guava 之间的冲突导致 ProGuard 错误

Conflict between Android data binding and Guava causes ProGuard error

在启用 ProGuard 的情况下编译我的 Android 应用程序时出现以下错误。

Warning: library class android.databinding.tool.util.SourceCodeEscapers 
    extends or implements program class com.google.common.escape.CharEscaper
Warning: library class android.databinding.tool.util.SourceCodeEscapers$JavaCharEscaper 
    extends or implements program class com.google.common.escape.ArrayBasedCharEscaper
Warning: library class android.databinding.tool.util.SourceCodeEscapers$JavaCharEscaperWithOctal 
    extends or implements program class com.google.common.escape.ArrayBasedCharEscaper
Warning: there were 3 instances of library classes depending on program classes.
         You must avoid such dependencies, since the program classes will
         be processed, while the library classes will remain unchanged.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#dependency)

这似乎是由于 Android data binding and Guava. My app depends on Guava (com.google.guava:guava:18.0) and has data binding enabled. It appears 数据绑定对 Guava 有某种内部依赖性并且导致 ProGuard 出现问题之间的冲突引起的。

我是 运行 gradle (2.0.0-beta5) 的最新测试版,所以问题可能与此有关。

所以我能够通过将其添加到混淆器来构建: -dontwarn android.databinding.** -keep class android.databinding.** { *; }

我认为忽略那些 类 并不是完全正确的解决方案,但我认为我们可能只需要等待 Google 的更新。将其添加到 proguard 后,我能够构建一个发布 apk 但它崩溃了,我认为它仍然是 proguard 但在我的代码中发现了其他错误。