gpt4 book ai didi

java - 在 null 上找不到值类型为 java.lang.String 的属性 'android:text' 的 getter

转载 作者:太空狗 更新时间:2023-10-29 14:41:00 24 4
gpt4 key购买 nike

我刚刚将我的一个项目的 AndroidStudio 从 2.3 版本更新到 3.0.1。当我尝试构建项目时,AndroidStudio 现在提示数据绑定(bind)问题。我正在使用 gradle 类路径的 alpha 版本

com.android.tools.build:gradle:3.1.0-alpha07

Error:(67, 17) Cannot find the getter for attribute 'android:text' with value type java.lang.String on null.

它提示的行使用了与 EditText 的双向数据绑定(bind)。

<android.support.design.widget.TextInputEditText
android:id="@+id/groupNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/text_hint"
android:imeOptions="actionNext"
android:maxLength="@{viewModel.maxLength}"
android:maxLines="1"
android:text="@={viewModel.title}"
android:textColor="@color/red"
app:filter="@{viewModel.inputType}"/>

viewModel 是类的实例,其 parent(BaseViewModel) 扩展 BaseObservable

请注意,它之前工作正常,当我更新 AndroidStudio 时它停止工作。我尝试了 clean/buildinvalidate/restart 选项,但没有成功。我真的很感激任何关于我所缺少的东西的指示。

最佳答案

就我而言,存在不止一个问题。我的应用程序使用了许多驻留在不同 repo 上的库模块。所以我更新了每个模块以使用相同的 gradle 版本(我使用 3.1.0)。然后我还更新了数据绑定(bind)库版本。
数据绑定(bind){
启用 = 真
版本“2.3.3”
}
希望对其他人有帮助。

关于java - 在 null 上找不到值类型为 java.lang.String 的属性 'android:text' 的 getter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48194306/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com