XXX cannot be resolved or is not a field
2014-03-19 23:00
561 查看
在Android开发中,自己定义了一个控件,然后在代码里写findViewById(R.id.xx)时,总是提示 XXX cannot be resolved or is not a field,我在网上搜的的解决办法是clean一下工程 然后build工程就可以了,或者fix project properties
,还有原因可能是添加文件,比如xml文件或者资源文件时,系统自动添加了import android.R;android.R是系统提供的资源,R是应用程序的资源,这时候只要删除
import android.R;这条语句就可以了。我自己的解决办法是在右击工程,在Android中换了个SDK版本就好了,更多资料可以看http://stackoverflow.com/questions/19385781/activity-display-message-cannot-be-resolved-or-is-not-a-field
,还有原因可能是添加文件,比如xml文件或者资源文件时,系统自动添加了import android.R;android.R是系统提供的资源,R是应用程序的资源,这时候只要删除
import android.R;这条语句就可以了。我自己的解决办法是在右击工程,在Android中换了个SDK版本就好了,更多资料可以看http://stackoverflow.com/questions/19385781/activity-display-message-cannot-be-resolved-or-is-not-a-field
相关文章推荐
- xxx cannot be resolved or is not a field
- xxx cannot be resolved or is not a field
- Eclipse Android项目 为控件添加了Id,但是在Java代码中提示xxx cannot be resolved or is not a field
- xxx cannot be resolved or is not a field问题的解决方案
- 添加jar包编译出现错误"XXX cannot be resolved or is not a field"解决方法
- Eclipse Android项目 为控件添加了Id,但是在Java代码中提示xxx cannot be resolved or is not a field
- R.xxx cannot be resolved or is not a field
- R.layout.xxx cannot be resolved or is not a field问题解决办法
- Android开发中Layout中明明改了id,但是还出现"cannot be resolved or is not a field"的原因
- import android.R 导致drawable下的图片找不到cannot be resolved or is not a field
- main cannot be resolved or is not a field
- layout cannot be resolved or is not a field
- Type activity_main cannot be resolved or is not a field
- Android Question - “Id cannot be resolved or is not a field” error?
- (Layout) cannot be resolved or is not a field 错误
- main cannot be resolved or is not a field
- main cannot be resolved or is not a field
- import android.R 导致drawable下的图片找不到cannot be resolved or is not a field
- activity_main cannot be resolved or is not a field