Thursday, March 22, 2012

Re: [android-developers] "R cannot be resolved to a variable" error in intro example code

On Thu, Mar 22, 2012 at 1:00 PM, firebreather
<michaelirvingbrown@gmail.com> wrote:
> when i try to run the intro example hello world code i get the error
> message "R cannot be resolved to a variable", for the
> "setContentView(R.layout.main)" line of the intro code.

Usually, this means that there is a bug in your manifest, or perhaps
one of your resources, that is preventing the tools from generating
the R class in your gen/ directory. You should see errors in your
development environment (e.g., messages on the command line during a
build, red X's in Eclipse).

I was running into some problems earlier today with the R17 tools,
where Eclipse refused to rebuild the gen/ folder, even though
command-line tools were working fine. Stopping and restarting Eclipse
cleared up that problem.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.7 Available!

--
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
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate