Log in or register to post comments

R cannot be resolved to a variable

January 12, 2014 - 3:11am #1

Hi,

 

I was trying to build the Vuforia samples. But I am getting this error R cannot be resolved to a variable. 

This is for all the projects. On investigating I found 

import com.qualcomm.vuforia.samples.BackgroundTextureAccess.R
import com.qualcomm.vuforia.samples.Books.R;
 
packages  are  missing from respective projects .  I tried to import android.R but it seems those packages have something extra like about_screen etc.
 
Could you please resolve this .
 
Thanks
Avishek
 

R cannot be resolved to a variable

February 24, 2017 - 2:13pm #6

how you resolve it plz ??

 

R cannot be resolved to a variable

January 13, 2014 - 2:17am #5

Ok, great to hear!

R cannot be resolved to a variable

January 13, 2014 - 1:29am #4

Thanks for the help ! I have resolved this 

R cannot be resolved to a variable

January 13, 2014 - 1:10am #3

Also, note that sometime Eclipse reports the R error because of other errors in the project (which prevents Eclipse from generating the R class correctly);

so, be sure to check that you have resolved any error in the Manifest of in one of the Layouts (for example, some layout error may arise from the fact that you are not building your project with a recent Android API, such as level 16 or level 17;  if that;s the case, you need to upgrade your Android SDK first, then rebuild the project)....

once you have fixed any other erros, by cleaning and rebuilding you should be OK;

also, do NOT import "android.R" .

 

R cannot be resolved to a variable

January 12, 2014 - 1:33pm #2

First try Cleaning ( Project > Clean ) your project to generate R  ( R = Resources )

If that doesn't work, here are some additional steps to investigate - http://stackoverflow.com/questions/7824730/r-cannot-be-resolved-to-a-variable

Log in or register to post comments