2

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

3 Answers 3

4

also probably delete this line which sometimes creeps up :

import android.R or something like that.

Sign up to request clarification or add additional context in comments.

4 Comments

this is not a permanent solution, you must have to clean and build again.
yeah i did but the problem is still continuing
thank you now no error but while running time the following error is coming "An internal error occurred during: "Launching New_configuration". Path for project must have only one segment."
@ezil: Go to Run>>Run configurations... and find "New_configuration" and delete this and run again.
1

Are you using Eclipse? Try project -> clean

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

5 Comments

s am using eclipse but still it is continuing may i want to refresh the install package
If a restart, clean and things like that do not work, you must check the errors and fix them. What errors do you have apart from the R related ones?
thank you but now while run time " 'Launching New_configuration' has encountered a problem. An internal error occurred during: "Launching New_configuration" error message is coming
“please enter a name and project for your run configuration”.
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.