In every instance in all of my classes where I reference R.id.something
, the R is in red and it says "cannot resolve symbol R".
And when I run 'app', it shows all the 'textColor' in styles.xml getting an error.
-
Check which R file is imported!– Paresh MayaniSep 22, 2015 at 5:35
-
Debug in your app...– Abhinav singhSep 22, 2015 at 5:35
-
when i click 'debug app' i will get: No resource found that matches the given name: attr 'textColor'.and debug stopped– AlexanderSep 22, 2015 at 5:45
-
@Alexander Please check my answer– IntelliJ AmiyaSep 22, 2015 at 6:17
2 Answers
@Alexander : Main reason is R.java not generating
.
Open the Android SDK Manager and Update with latest:
- Android SDK Tools
- Android SDK Build Tools
Then Clean with Re-Build and Restart Your Project
And
Android Studio marks R in red with error message "cannot resolve symbol R", but build succeeds
Try this way ,I hope it will helps you .
-
1I update SDK and restart project but the error still exists.I delete xml files which i create lately,but it's doesn't work Sep 22, 2015 at 6:40
-
-
@Alexander This is a very common problem .Using Android studio or eclipse ? Sep 22, 2015 at 6:44
Problem of appcompat.. untill your res folder contains error. R.java will not be generated.