我正在尝试消除Android项目中的Lint警告。这样做会遇到以下我不理解的警告消息:
app\src\main\res\layout-land\event_settings_fragment.xml:25: Error: Class referenced in the layout file, com.google.android.material.textfield.TextInputLayout, was not found in the project or the libraries [MissingRegistered]
<com.google.android.material.textfield.TextInputLayout
^
我的应用程序似乎运行良好,因此com.google.android.material.textfield.TextInputLayout
类应该在项目中可用吗?请注意,我在所有com.google.android.material.*
类上均收到此警告。
缺少注册
摘要:缺少注册的课程
优先级:8/10严重性:错误
类别:正确性
注意:此问题默认为禁用!
您可以通过添加--enable MissingRegistered来启用它>
如果在清单或布局文件中引用了一个类,则它还必须存在于项目中(或存在于项目所包含的库之一中。这检查有助于发现注册名称中的错别字,或尝试重命名或移动类,而没有正确更新清单文件。
参见:http://tools.android.com/tips/lint-checks
如果确保布局文件运行没有问题,则可以禁用该检查:
app/build.gradle android{ lintOptions{ disable "MissingRegistered" } }
或在布局文件中添加
tools:ignore="MissingRegistered"
以取消检查。