The project compiles fine. However, Android studio 3.0.1 shows reference to one particular library in red and displays \"cannot resolve symbol\". Even single stepping into
This has happened to me a couple of times, there are a few ways you can resolve this problem;
For me problem was that AS suggested I upgrade gradle version, (from 3.5 to 4.4), and then it started doing it.
Solution was to delete the 3.5 folder from .gradle in project
None of the answers worked for me
Removing & adding all java files via Project window on the left side of Android Studio
Commenting/un-commenting & syncing libraries in the gradle file in small groups.
And cleaning all caches before that (as part of other fixes here).
Following has resolved this for me.
Tried all of the above but nothing worked.
Got Solution by: 1. Updating Android studio to latest version 2. Updating the Gradle version to latest one
I've tried Invalidate Caches/Restart...
, tried manually delete .idea
and .build
folders and it didn't work for my case.
I using VCS (git
) and I just commit my changes, removed the whole project, and Checkout from Version Control
. It fixed this problem.
Android Studio 3.6.3