Sebosin
Sebosin

Reputation: 177

R cannot be resolved to a variable. Eclipse error

Good morning.

I am creating a "Android Application Project" and I get an error "R can not be resolved to a variable". The error I get nothing and create the blueprint (the "Hello World") without adding any thing more (the basic example).

Thank you.

PS: Platform SDK: API 17; Android SDK Tools: 22.0.1, Build-Android SDK Tools: 17.

Upvotes: 0

Views: 967

Answers (2)

Traxex1909
Traxex1909

Reputation: 2710

'R' isn't generated if there are any errors in your XML files. So check all your XML files. Check for errors in naming the XML files. No capital letters etc.

If you're using Eclipse, it helps if you delete your gen folder and add it using Project > Properties > Java Build Path > Source tab > Add Source > Select gen and then Clean and Build your project

Upvotes: 2

g00dy
g00dy

Reputation: 6778

As stated here:

After updating to SDK Tools to rev. 22 for the first time, you may need to relaunch Android SDK Manager again and install a new item: Android SDK Build-tools. enter image description here

After installing this, clean your projects and rebuild.

Upvotes: 3

Related Questions