Android Studio 3.1.0更新后无法生成数据绑定 [英] Android Studio fails to generate databinding after 3.1.0 update
问题描述
今天早上我将 android studio
从 3.0.1 更新到 3.1.0.将 gradle
更新到最新版本后,我仍然收到有关数据绑定的构建错误.
This morning I made an update to android studio
from 3.0.1 to 3.1.0. After updating the gradle
to latest version I still get build error regarding data binding.
我的gradle-wrapper.properties
:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
我所有的错误都如下所示:
All my errors are like the one below:
/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 更新后不会生成?提前致谢
Does anyone have any idea why would my data binding not generate after the android studio 3.1 update? Thanks in advance
忘了说,我试过清理/重建/无效缓存&重新启动/删除构建文件夹.
Edit 1: Forgot to say, I tried clean/rebuild/invalidate cache & restart/deleted build folder.
推荐答案
好的,所以那些想知道我是如何解决这个问题的人.解决方案非常简单,但您可能不会喜欢它.
Ok, so those who are wondering how I fixed this. The solution is quite simple but probably you won't like it.
我不得不将所有用于数据绑定的类移动到项目根包中,并在它再次开始工作后.
I had to move all my classes that were used in data binding in the project root package and after it started to work again.
这篇关于Android Studio 3.1.0更新后无法生成数据绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!