R.java is a file that the Android Eclipse plugins creates while building your application.R.java is created under the "gen" directory. This file is generated from the information in the "res" directory. If you run select "Project" -> "Clean..." on the Eclipse menu, it will remove and then regenerate the R.java file.
The problem "R cannot be resolved" happens when you change your package name in the Androidmanifest.xml file. It uses your Android package name to create a subdirectory under the "gen" directory where it stores the R.java file. Eclipse may have problems executing clean, because it is confused about where the R.java file is when you have changed the Android package name. You can either rename the subdirectory under gen to match your new package name, or you can change your package name back to the old name. Do the clean and then change the package name to the new name you want. This works best if you stop Eclipse from trying to build while you are changing the package name. Under the "Project" menu uncheck the option to "Build Automatically" and also when the "Clean..." dialog asks if it should "Start a build immediately" uncheck the box so it doesn't try to build while you are changing the package name. After you have changed the name you can turn "Build Automatically" back on again. On Sun, Nov 4, 2012 at 2:58 AM, Kevin Brooks <[email protected]> wrote: > It has been a while since I have done any Android Development. I started > a new project today, and after creating the project I get an error R can > not be resolved. > > I am using Eclipse Indigo 3.7 with the Latest Android SDK. > > I apologize if this has already been answered, I did a search through the > messages and couldn't find it. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to > android-developers@**googlegroups.com<[email protected]> > To unsubscribe from this group, send email to > android-developers+**[email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/**group/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en> > -- *Sobia Awan* * Bs(cs)* ** -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

