G.V.Raghuram.
G.V.Raghuram.

Reputation: 29

R cannot be resolved to a variable

I have implemented the actionbarsherlock in my project and after implementation and my project is full of errors and it is "R cannot be resolved to a variable". I have tried a lot to clear this and i cant get the solution.Please help me to solve this.

Upvotes: 1

Views: 336

Answers (3)

Jibran Khan
Jibran Khan

Reputation: 3256

Remove the line from import section if you have "import android.R"

Upvotes: 0

Ankitkumar Makwana
Ankitkumar Makwana

Reputation: 3485

first otion is make project clean and Rebuild your project or if there is any image name in drawable missing in Uppercase or any other option with not allowed may possible to check, or in xml layout check all files is well define and is that no any xml error due to this resone may R file is remove

Upvotes: 0

Pragnani
Pragnani

Reputation: 20155

If you your code contains errors then R.java won't generate, if the errors are about R.java then Just clean the project once, and build it again. If the erorrs are not resolved then check for the imports you may have mistakely imported android.R.java.

Upvotes: 2

Related Questions