Cannot resolve symbol R


So I was working through the book, currently building CriminalIntent, when I found that as soon as I added the RecyclerView dependency, my program suddenly loses the ability to resolve R. I’ve tried pretty much everything (Cleaning and rebuilding the program, making a small change to gradle and rebuilding, restarting AndroidStudio, and even going so far as to move all my files to a secure location and completely uninstall AndroidStudio and reinstall). I’m at a loss. What can I do to resolve this?


Try to complety delete folder build


Do I need to do anything after that? I.e. clean and rebuild, etc?


And Android Studio creates this folder again


Tried that. When I do, I get these errors


This problem happened to me during the Geoquiz for no apparent reason. I closed the project and Android Studio and it resolved itself.


I already tried that, but to no avail


Your problem caused by an incompatibility with the android support library version.
ALL support libraries MUST have the same version.
(Do not use 28.0.0-alpha)

So, check your build.gradle

For example, use 26.1.0:

  implementation ''
  implementation ''


I fixed the error in my recyclerview line, but I get this error for the appcomat line:

Thanks a ton, by the way.


Please show full dependencies section in your build.gradle


Absolutely! Sorry about that


Hmm… All must be fine. I don’t see more problems. Try menu “Tools” - “Android” - “Sync Project with gradle files”


No effect. If it helps, R can now apparently be resolved; the only issue is the one with implementation ‘’

EDIT: changing both lines to use v7:26.1.0 seems to have worked