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
Do I need to do anything after that? I.e. clean and rebuild, etc?
And Android Studio creates this folder again
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
So, check your
For example, use
implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.android.support:recyclerview-v7:26.1.0'
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
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 ‘com.android.support:appcompat-v7:26.0.0’
EDIT: changing both lines to use v7:26.1.0 seems to have worked