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

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

概述今天早上我从3.0.1到3.1.0更新了androidstudio.将gradle更新到最新版本后,我仍然会遇到有关数据绑定的构建错误.我的gradle-wrapper.properties:distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip我的所有错误都如下所示:/Users/mp/Documents/

今天早上我从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/

总结

以上是内存溢出为你收集整理的3.1.0更新后,Android Studio无法生成数据绑定全部内容,希望文章能够帮你解决3.1.0更新后,Android Studio无法生成数据绑定所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1098124.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-28
下一篇2022-05-28

发表评论

登录后才能评论

评论列表(0条)

    保存