Android: “R cannot be resolved to a variable” What is R? Why is it so Cryptic? (via: Stack Overflow)
Posted by jpluimers on 2014/04/03
If I ever get “R cannot be resolved to a variable” in an Android project again, then I should read these posts:
- Android: What is R? Why is it so Cryptic? – Stack Overflow.
- eclipse – R cannot be resolved – Android error – Stack Overflow.
- android – How to duplicate an SDK-sample project into workspace? – Stack Overflow.
- android – com.example.helloandroid.R.id cannot be resolved – Stack Overflow.
One of the quotes was the culprit:
*Note: Eclipse sometimes likes to add an “import android.R” statement at the top of your files that use resources, especially when you ask Eclipse to sort or otherwise manage imports. This will cause your make to break. Look out for these erroneous import statements and delete them.*
–jeroen






Leave a comment