Reputation: 6317
R cannot be resolved to a variable. So I tried to do "fix project setup", but then it can't identify all of its subcontent, such as objects from my xml
, R.id.X
, R.drawable.Y
, none of them are identified.
I just tried to follow http://developer.android.com/guide/topics/ui/controls/pickers.html guide and add such class to have a dialog for choosing time.
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
Upvotes: 0
Views: 2762
Reputation: 11608
R.java
is not created, delete the gen folder, then re-create it manually, right-click, Build Path - use as source folder, rebuild the projectR.java
is still not there, there is a probability that some of your XML files contain errors, check thatUpvotes: 1
Reputation: 6778
The above answer states it clearly. Take a look at your layout files and a hint from me: When I filled by strings.xml file, I found out, that when copying some colors there, I closed the tag with a tag. This is easily overlooked thing and i intend of writing a class which detects this, because apparently this isn't going to be fixed anytime soon (by fixed I mean at least a notification for us).
Upvotes: 1
Reputation: 16364
Do Project -> Clean for a few times.
And then Build the project.
If you still cant find R.java
in the gen
folder, check if you have ANY errors in your layout
files, for example check if all your xml files
and drawables
are named only in lower-case letters.
After removing these errors, Clean and Build once again.
Upvotes: 2