无法将R解析为变量。所以我尝试做“修复项目设置”,但是它无法识别所有子内容,例如来自xml
,R.id.X
,R.drawable.Y
的对象,其中没有一个是识别。
我只是尝试按照http://developer.android.com/guide/topics/ui/controls/pickers.html指南添加此类,以便有一个选择时间的对话框。
Description Resource Path Location Type
users cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 170 Java Problem
ic_launcher cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 159 Java Problem
about cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 136 Java Problem
menu_user cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 133 Java Problem
imp_logo cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 198 Java Problem
activity_main cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 44 Java Problem
timerCB cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 64 Java Problem
timerTime cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 65 Java Problem
statusText cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 66 Java Problem
timerText cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 67 Java Problem
start_button cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 68 Java Problem
stop_button cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 69 Java Problem
activity_main cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 123 Java Problem
menu_url cannot be resolved or is not a field MainActivity.java /RemoteSwitch/src/com/example/remoteswitch line 130 Java Problem
答案 0 :(得分:2)
项目 - >清洁几次。
然后构建项目。
如果您仍然无法在R.java
文件夹中找到gen
,请检查layout
个文件中是否有任何错误,例如检查所有xml files
和{ {1}}仅以小写字母命名。
删除这些错误后,再次清理并构建。
答案 1 :(得分:2)
只需删除import android.R
即可。
答案 2 :(得分:1)
R.java
,请删除gen文件夹,然后手动重新创建,右键单击,构建路径 - 用作源文件夹,重建项目R.java
仍然不存在,则某些XML文件可能包含错误,请检查答案 3 :(得分:1)
上述答案清楚地说明了这一点。看看你的布局文件和我的提示:当我填充strings.xml文件时,我发现,在那里复制一些颜色时,我用标签关闭了标签。这很容易被忽视,我打算写一个检测到这个的类,因为显然这不会很快修复(修正后我的意思是至少给我们一个通知)。