0

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.

4
  • Check which R file is imported! Sep 22, 2015 at 5:35
  • Debug in your app... Sep 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
    – Alexander
    Sep 22, 2015 at 5:45
  • @Alexander Please check my answer Sep 22, 2015 at 6:17

2 Answers 2

1

@Alexander : Main reason is R.java not generating .

Open the Android SDK Manager and Update with latest:

  1. Android SDK Tools
  2. Android SDK Build Tools

Then Clean with Re-Build and Restart Your Project

"cannot resolve symbol R" in Android Studio

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 .

3
  • 1
    I 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, 2015 at 6:40
  • @Alexander Update support repository . Sep 22, 2015 at 6:43
  • @Alexander This is a very common problem .Using Android studio or eclipse ? Sep 22, 2015 at 6:44
0

Problem of appcompat.. untill your res folder contains error. R.java will not be generated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.