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 that library module doesn't work.
I already tried various options like 1) Invalidate cache/restart 2) deleted build directory 3) clean and rebuild but nothing seems to be working.
Interestingly, when Android Studio is rebuilding indexes after invalidate/restart, it momentarily shows that library references in while but then again in red.
Most often “R cannot be resolved” error appears if there is an issue with some of your resource files. Due to this error, you are unable to build your application. That's why we need to solve this error as it not getting away by just doing a simple restart or hitting Alt+Enter.
“cannot resolve symbol” means that the Java compiler cannot locate a symbol referenced in your Java source code. The causes for this common error include: A missing class file. A faulty CLASSPATH.
I tried Invalidate cache/restart
or clean Project -> rebuild project
. These didn't work for me.
The final solution was open Project window on the left side of IDE, under Project mode, delete .gradle
and .idea
folder, then sync, it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With