Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
638 views
in Technique[技术] by (71.8m points)

eclipse - R cannot be resolved - Android, no import android.R; statement

Ok, I am working on a new app and everything worked fine as long as I used a Relative View. However, I want a tabbed layout so I switched what I had (not much so far since I just got it reading from a DB and settings working) over to a tabbed view. Since that time, any class that has any R. statement in it has an "R cannot be resolved" error. I am following the tutorial from the Android "Hello Views" tutorial so I am assuming that isn't the issue (but it could still be).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I have a few suggestions:

  1. Make sure you don't have any other errors other than the R-related errors. Right-click your project folder in Eclipse, Android Tools -> Fix Project Properties.

  2. Check to make sure you have the correct R imported. Sometimes the default Android.R can be imported.

  3. Check for errors in your layout XML files.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...