解决 cannot be resolved or is not a field

简介:

场景

DescriptionResourcePathLocationType

bt_mycity cannot be resolved or is not a fieldChangeCityActivity.java


原因

    该变量没有在布局文件xml中定义。双击错误,然后跳转到错误页面,按下Ctrl,鼠标点击变量发现无法跳转到变量定义的布局文件,正常情况下如果有定义,是可以正常跳转的


解决

    在布局文件中添加该变量的定义。如果该布局页面没有被实际使用到,可以直接删除该错误,通知编译器忽略该错误,就可以顺利编译,不妨碍正常安装


注意

    忽略错误信息,在跳转到该页面的时候,可能会出现崩溃





     本文转自fengyuzaitu 51CTO博客,原文链接:http://blog.51cto.com/fengyuzaitu/1615948,如需转载请自行联系原作者

相关文章
|
10月前
|
Java Android开发
**** cannot be resolved to a type
这种错误很常见,90%的原因都是没有导入jar包,如果导入的jar包都正确,那么很有可能是一下两个原因导致的
58 0
|
6月前
Missing required prop: “modelValue“
Missing required prop: “modelValue“
|
10月前
|
数据库 OceanBase
RuntimeError: 'PluginContext' object has no attribute 'set_variable'
RuntimeError: 'PluginContext' object has no attribute 'set_variable'
86 2
|
12月前
TypeError: custom() got an unexpected keyword argument ‘path‘
TypeError: custom() got an unexpected keyword argument ‘path‘
112 0
|
Java
The type XXX cannot be resolved. It is indirectly referenced from required .class files
The type XXX cannot be resolved. It is indirectly referenced from required .class files
86 0
解决办法:Type safety: The expression of type List needs unchecked conversion to conform
解决办法:Type safety: The expression of type List needs unchecked conversion to conform
192 0
AttributeError: 'module' object has no attribute 'X509_up_ref'
AttributeError: 'module' object has no attribute 'X509_up_ref'
135 0
|
SQL 并行计算 PyTorch
解决报错:‘NoneType‘ object has no attribute ‘origin‘
在跑几个月前跑过PyG的GNN模型时,突然当头一棒报错:'NoneType' object has no attribute 'origin',不要慌,赶紧百度 一顿操作猛如虎,发现没几个帖子讲这个,然后发现google后git
1028 0
解决报错:‘NoneType‘ object has no attribute ‘origin‘
成功解决AttributeError: 'MapDataset' object has no attribute 'group_by_window'
成功解决AttributeError: 'MapDataset' object has no attribute 'group_by_window'
成功解决AttributeError: 'MapDataset' object has no attribute 'group_by_window'