R cannot be resolved!

by ramywhite » Fri, 18 Jul 2008 21:40:55 GMT

Sponsored Links
I am new to Android. I have opened the notepad tutorial and it worked
very fine with Eclipse 3.4.0 under Windows XP but when I tried to open
the Snake sample, it gave me an error " R cannot be resolved" I have
noticed that there is no R.java in the project. What is I did wrong?
Any help will be appreciated.
Many thanks


R cannot be resolved!

by Mark Murphy » Fri, 18 Jul 2008 21:52:10 GMT

 > I am new to Android. I have opened the notepad tutorial and it worked

I can't speak specifically for Eclipse.

However, R.java is generated as part of the Android project build process.
If you haven't compiled the project yet, R.java probably does not exist.
Try building it, following the instructions on the Android Web site, and
see if that clears up your problem:

 http://code.google.com/android/intro/installing.html #developingwitheclipse

Mark Murphy (a Commons Guy)
_The Busy Coder's Guide to Android Development_ -- Available Now!


Sponsored Links

R cannot be resolved!

by ramywhite » Sun, 20 Jul 2008 00:36:02 GMT

 Hi Mark,
Thank you for your nice replay. I did as you said and I have
successfully built all the samples except 2 samples "Snake" and
"LunarLander". I don't know why. What is the difference between those
2 and the others?
Thank you


R cannot be resolved!

by Mark Murphy » Sun, 20 Jul 2008 01:37:37 GMT


1. Did you get specific build-time or run-time errors for them? If so, 
what are the error messages?

2. Have you tried building them outside of Eclipse?

Again, I'm not an Eclipse guy, so I will not be much help with 
Eclipse-specific issues.

Mark Murphy (a Commons Guy)
Warescription: All titles, revisions, & ebook formats, just $35/year


Other Threads

1. Wiki for Android development

Hi guys,

I'm not sure if my idea is new at all, however, I think it would be
very useful if experienced Android developers willing to share their
knowledge could post some articles on development practices. Sample
codes, resolutions for pitfalls, etc. would always come in handy and
they should be located in a central place, like a Wiki. I know Knol is
Google's own Wiki, I'm just unsure if it's main intention to hold
Android-specific articles, too.

Do you find this idea useful? Is there any chance that such a system
will be available in the near future?




2. Assuming Developers are Pirates

I just wanted to start a thread expressing my displeasure with the
choice to block copy-protected apps from being made available to
ADPs.  The thing that drew me to the android platform was the fact
that it had such a lower barrier to entry.  I can't afford to have two
phone plans going.  The idea of investing $425 to allow me to have one
device to both develop for and use for my day to day life was very
attractive.  However, Google's recent assumption that developers will
pirate drm'd software simply because they can is ridiculous. If
someone wanted to pirate software, they'd simply open a t-mobile
account, unlock the phone, and save $300+.  I hope Google reconsiders.


3. second resources.getDrawable() fails

4. Any Listener for shake movement ?

5. timer_create problem

6. help about SMS BroadcastReceiver conflict with GPS LOCATION_SERVICE

7. how to update the firmware of the dev phone to 1.1?