KoolKid
KoolKid

Reputation: 1

Android: Errors With R Only When Try To Compile

My app suddenly has come up with lots of errors when trying to compile and push onto my phone. I get errors such as this one:

java: C:\Users\Steven\workspace\RandomGenie\src\com\frostbytedev\randomgenie\Menu.java:15: cannot find symbol
symbol  : variable layout
location: class com.frostbytedev.randomgenie.R

The problem is in the source code there are no errors showing and nothing is underlined. What could be causing this and any quick fixes?

Upvotes: 0

Views: 59

Answers (2)

Asiimwe
Asiimwe

Reputation: 2259

check all your xml files in the res folder.... make sure there aren't any errors in them, when you make a change please ctrl+s then click project and select clean, check the build project as well. also you could restart your IDE.

Upvotes: 1

i_me_mine
i_me_mine

Reputation: 1433

If you try and compile or build your project while the XML file has errors your R.java file will not be created. Look in the gen folder and I can almost guarantee there is no R.java file. Search your XML files for an error. If you find that, post it or fix it then your app will compile and run again.

Upvotes: 0

Related Questions