开发者

What can I do with R cannot be resolved problem?

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, l开发者_Python百科ook 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


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.


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


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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜