0

If I make a new Android project in Ecplipse and I try, to open one of the samples from android SDK, I have got an error, look like this:

R cannot be resolved

What can I do, to be able, to run these files? I tried to delete import android.R; but nothing changed.

Thanks

Zwiebel
  • 1,605
  • 4
  • 21
  • 37
  • possible duplicate of [R cannot be resolved - Android error](http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error) – Jens Feb 03 '11 at 14:30

3 Answers3

1

First thing you might try is "clean" your project (option in the menu). If it persists:

There should be an error that stops R from being generated. Check the "problems" tab (?) in eclipse to see what that problem is, and solve that. It could be missing libs, or various other stuff.

Nanne
  • 64,065
  • 16
  • 119
  • 163
1

You possibly got error in building resources. Possible fixes:

-refresh your project (F5)

-clean you project and refresh

-see "Console" tab, sometimes the problem is shown there

-reload the Android SDK

-restart the Eclipse IDE

Kiril Kirilov
  • 11,167
  • 5
  • 49
  • 74
0

Check your XML-Layout files. The problem come here half a time.

If you are sure it is note your layout file, check in your java build path if the google librarys are well set. (Google APIs)

(sorry for my bad english)

zobi8225
  • 2,258
  • 4
  • 20
  • 20