Possible Duplicate:
R cannot be resolved - Android error
I can't create a new android project, neither in windows or Ubuntu! I have 2.3.3 and 2.2 and 4.0 versions of android sdk and I want to create a new project using 2.3.3 version. But after creating the project it says R cannot be resolved to a variable.
I have read all the questions related to this topic and I have done all the suggested solutions but none of them worked for me. (Clean Project , check Android version in Build path menu, checking xml files, lower case xml file names and etc)
Since I'm using a blank project, it's not because of some incorrect xml files or some errors in java codes.(for god sakes its a blank project!! how could it be broken?)
I don't know what to do. any suggestions would be appreciated.
If cleaning the project doesn't work and if there is no problem with xml files(as it is a new project). Then go to androidmanifest.xml
,edit it and add some spaces between the lines, save it. Now clean the project, error will vanish.
This happens because of stale r.java
file. When we edit android manifest file,R.java is created again.
It happen's because of error's in XML files, review all xml files and check your Problems
window. and then clean your project..
Hope it will work..
I had exactly same problem. Here is what worked for me:
import android.R;
import android.R;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With