3.1.0更新后,Android Studio无法生成数据绑定

今天早上我从3.0.1到3.1.0更新了android studio.将gradle更新到最新版本后,我仍然会遇到有关数据绑定的构建错误.

我的gradle-wrapper.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

我的所有错误都如下所示:

/Users/mp/Documents/GitHub/projectx/app/build/generated/source/dataBinding/baseClasses/Staging/debug/me/projectx/asdasd/databinding/GridItemActivityTypeBinding.java:57: error: cannot find symbol
      @Nullable DataBindingComponent component) {
                ^
  symbol:   class DataBindingComponent
  location: class GridItemActivityTypeBinding

有没有人知道为什么我的数据绑定不会在android studio 3.1更新后生成?提前致谢

编辑1:忘了说,我试过清理/重建/无效缓存&重启/删除构建文件夹.

解决方法:

在更新到Android Studio 3.2后,此行适用于我.我在我的项目中运行了Java和Kotlin代码(编译器).

将以下内容添加到gradle.properties:
android.databinding.enableV2 = FALSE

原因:

Data Binding V2

Data Binding V2 is Now enabled by default and is compatible with V1. This means that, if you have library dependencies that you compiled with V1, you can use them with projects using Data Binding V2. However, note that projects using V1 cannot consume dependencies that were compiled with V2.

来源(发行说明):https://developer.android.com/studio/releases/

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...