R.java Missing in Android Project in NetBeans

r43r31 picture r43r31 · May 26, 2011 · Viewed 13.8k times · Source

I'm doing this for a project in AP Computer Science.

Basics:
Mac OS X 10.5.8
NetBeans 7.0
Android SDK 3.0 (Level 11)

So I'm trying out some of the Android API Demos in NetBeans (I prefer it over Eclipse) and I'm using samples\android-11\ApiDemos\ for the source. The R.java file is not generating and "package R does not exist". I've looked at other answers, and they say to Clean and Build the Project, but that option is grayed out in NetBeans (so are just the "Clean" and "Build" options). Any ideas on what I should try before I switch to Eclipse? I also have a computer running Windows 7 if I need to change the OS. Thanks!

Answer

Christopher Cato picture Christopher Cato · Jan 21, 2012

Right-click your project and hit build. It will generate the missing R class for you. At least it did for me in Netbeans 7.1