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. How to use AUDIO_SERVICE ?

While calling:
AudioManager aManager = (AudioManager) ct.getSystemService

i get this error :

E/AndroidRuntime(  416): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime(  416): java.lang.RuntimeException: Unable to start
activity ComponentInfo{com.fmcc.callrecorder/
com.fmcc.callrecorder.CallRecorder}: java.l
E/AndroidRuntime(  416):        at
E/AndroidRuntime(  416):        at
E/AndroidRuntime(  416):        at android.app.ActivityThread.access
E/AndroidRuntime(  416):        at android.app.ActivityThread
E/AndroidRuntime(  416):        at android.os.Handler.dispatchMessage
E/AndroidRuntime(  416):        at android.os.Looper.loop(Looper.java:
E/AndroidRuntime(  416):        at android.app.ActivityThread.main
E/AndroidRuntime(  416):        at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  416):        at java.lang.reflect.Method.invoke
E/AndroidRuntime(  416):        at com.android.internal.os.ZygoteInit
E/AndroidRuntime(  416):        at
E/AndroidRuntime(  416):        at dalvik.system.NativeStart.main
(Native Method)
E/AndroidRuntime(  416): Caused by: java.lang.NullPointerException
E/AndroidRuntime(  416):        at
E/AndroidRuntime(  416):        at
E/AndroidRuntime(  416):        at
E/AndroidRuntime(  416):        ... 11 more

What have i doing wrong ?


2. Collection of ADC2 App Winner APK Pac

Barusan main ke droidappz ternyata dah ada yg ngumpulin apk-nya ADC2 App Winner!

monggo diunduh:


kalo dari comment2 di forum itu masih ada beberapa yg gak jalan. gw
juga blon nyobain sih, baru donlot aja :)

 * @Name Rayhan
 * @GTalk saviourcat
 * @Yahoo md_ray
 * @Twitter md_ray
 * @SentFrom web

Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group:


3. GK : How to Use Android Open source Platform code

4. Is there any posibility to know the size of the video file?

5. Can I protect the usage of my own Platform Java API using signatures or similar protection?

6. Android on treo 650

7. Where to get a Samsung Moment for development