Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to overcome Android Studio cannot resolve symbol for android classes

I'v just installed Android Studio 0.8.2 for my first time and I have a lot of "Cannot resolve symbol" errors. The errors occur on both new projects and projects which were exported from eclipse.

JDK version: jdk1.8.0_11

Android studio errors: Android studio errors

Project's grade file enter image description here

like image 398
Idob Avatar asked Jul 26 '14 11:07

Idob


People also ask

What is Cannot resolve symbol in Android Studio?

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.

What does Cannot resolve symbol mean in Java?

In JavaLanguage, if you get 'cannot resolve symbol', you have used a name that the compiler hasn't recognized. Class names -- If it is a class name, the compiler cannot find the class.


2 Answers

You can do "File" -> "Invalidate Caches...", and select "Invalidate and Restart" option to fix this.

like image 197
Priyanthi Avatar answered Oct 02 '22 14:10

Priyanthi


Android Studio suddenly cannot resolve symbols helped:

  • Exit Android Studio
  • Back up your project
  • Delete all the .iml files and the .idea folder
  • Relaunch Android Studio and reimport your project
like image 22
serv-inc Avatar answered Oct 02 '22 15:10

serv-inc