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.
Asked
Active
Viewed 541 times
0

S.L. Barth is on codidact.com
- 8,198
- 71
- 51
- 66

Alexander
- 141
- 1
- 1
- 6
-
Check which R file is imported! – Paresh Mayani Sep 22 '15 at 05:35
-
Debug in your app... – Abhinav singh Sep 22 '15 at 05:35
-
when i click 'debug app' i will get: No resource found that matches the given name: attr 'textColor'.and debug stopped – Alexander Sep 22 '15 at 05:45
-
@Alexander Please check my answer – IntelliJ Amiya Sep 22 '15 at 06:17
2 Answers
1
@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 .

Community
- 1
- 1

IntelliJ Amiya
- 74,896
- 15
- 165
- 198
-
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 – Alexander Sep 22 '15 at 06:40
-
-
@Alexander This is a very common problem .Using Android studio or eclipse ? – IntelliJ Amiya Sep 22 '15 at 06:44
0
Problem of appcompat.. untill your res folder contains error. R.java will not be generated.

Bpatel
- 77
- 8