I have searched many questions but cant seem to get solution to my problem. The issue came after i Updated using download manager while my eclipse was running.
The Problem:
Whenever i do clean build , "R cannot be resolved to a variable"
issue comes.
R is not present in gen folder.
If i comment all the places R is used, the R.java gets generated, I uncomment the code containing R.id.. and things run normally , only to come up again if clean build is triggered.
If I build normally, the changes are not getting reflected.
How issue came:
Download manager - > Update.
Intall 16 packages button - didnt do much, because some peer connection refused issue came.
- Delete 1 package option. I used this option twice and deleted 2 folders whise names I dont remember.
After this all projects had thousands of compilation errors. The tools folder was not present. Added that by unzipping it.
Now whenever i do clean build , "R cannot be resolved to a variable
".
R is not present in gen folder.
If i comment all the places R is used, the issue is gone, I uncomment the code and things run normally , only to come up again if clean build is triggered.
Solutions tried:
No issue in any of XML's because it generates if R is not used
Project -> Build project
- Build automatically
- Project -> Add support
It seems some tool is not running properly. Earlier, whenever I would do Project-> run as->, R would get generated. Now apk is not present error comes.
Update:: Project -> Run As -> Error "AndroidManifest.xml is missing" If I open manifest by double click, error comes:
parseSdkContent failed
Could not initialize class android.graphics.Typeface
parseSdkContent failed
java.lang.ExceptionInInitializerError
Have deleted the home/.android folder , still error is coming. The original R error is still coming.
Update2: 1. The issue android manifest error goes by clean build. 2. Then another error came, so I included ..\appcompat_v7 in android library 3. Now there were 2 android-suppport-v4.jar. So i manually deleted one of them. 4. Now my changes are not getting reflected on build. And on clean build, R issue comes.