ezhil
ezhil

Reputation: 2606

R cannot be resolved-android

R cannot be resolved R.layout.main cannot be resolved error is repeating to me and i cant run any of my android program

pls give any instruction

Upvotes: 2

Views: 7472

Answers (3)

Barry
Barry

Reputation: 1258

I just had a reoccurence of the dreaded "R cannot be resolved" error, and I went through all the usual fixes; make sure all resources have lower case names, do a clean, make sure there isn't an import android.R lurking somewhere... no luck.

After a couple of frustrating hours I realised I had saved a PaintShop Pro format file (something.psp) in a resource folder in the file system and Eclipse was pulling it into my res folder. Not being a .png, it choked, and that seemed to cause the problem. As soon as I removed the .psp the error disappeared.

Hope this helps prevent someone else pulling out their hair.

Upvotes: 1

Abhishek Susarla
Abhishek Susarla

Reputation: 578

also probably delete this line which sometimes creeps up :

import android.R or something like that.

Upvotes: 4

Nanne
Nanne

Reputation: 64399

Are you using Eclipse? Try project -> clean

Otherwise: check your console in the bottom for errors that need fixing before your R is build

Upvotes: 1

Related Questions