i'm new to android, i'm getting this error. please help me in providing the solution
Thanks in advance.
i'm new to android, i'm getting this error. please help me in providing the solution
Thanks in advance.
R cannot be resolved to a variable When we will get this error.
R.java is an automatically generated file to hold all your resources used in project. It will be created under gen folder when you build your project. While building your project it will assign IDs to each resource you used in project and keeps them in their individual classes (drawable, id, layout, etc.) and creates a file R.java, place it in your package.
If anything wrong in your resource files (drawables or xml layouts) it won't generate R.java file.
So please check it once. I too faced same problem previously.
All the resources in Android are referenced by an 'id'. This 'id' is generated automatically in the file 'R.java', which itself is generated in automatically in 'gen' folder, once you build the project. So, what you have to do is just 'Build your Project'
Build you project and you will get you.package.name.R.java
file - and just import it.
I think I saw the problem. You are having 2 folders named 'res'. Just delete the res folder which is empty and Clean, build the project
if your gen folder is still missing then check whether you have done installation properly and then check if you have any error on any of the xml files in your project
refer following links
R cannot be resolved - Android error
No generated R.java file in my project
No generated R.java file in my project
http://www.joshuakerr.com/2009/10/23/android-and-the-missing-gen-folder/