Idob
Idob

Reputation: 1650

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

Upvotes: 66

Views: 129816

Answers (8)

pedagogyfirst
pedagogyfirst

Reputation: 53

Apparently the xml must be in the "drawable" folder. That fixed it for me.

Upvotes: 2

BuddyCarver
BuddyCarver

Reputation: 41

Did you install any plugins before this issue started occurring? I installed the CSVreader plug in and it took me forever to find out what the problem was. Look at the bottom right of the screen and see if there is a red dot. If it is there, click on it, it should list out lots of errors and above that it will say "uninstall plug in" next to the plug in that has the issue with it. click that, restart Android studio and your problem will be fixed (if a Plugin is the issue).

Upvotes: 0

Gunreet Kaur
Gunreet Kaur

Reputation: 11

I cannot explain logic behind this one but it absolutely worked for me. For the symbol that is being shown in red or gives error of 'Cannot resolve', press backspace and type that particular symbol again.

Again, it's crazy but worked for me

Upvotes: 1

Albert
Albert

Reputation: 183

Delete folder: C:\Users\{your-user}\.AndroidStudio{your-version}\system\caches

It helped me

Upvotes: 1

Karegyeya Calvin
Karegyeya Calvin

Reputation: 11

I run into the same problem, i solved it by performing a clean project. To do this go to;

Select build>-clean project>

Upvotes: 0

serv-inc
serv-inc

Reputation: 38157

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

Upvotes: 28

Priyanthi
Priyanthi

Reputation: 1785

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

Upvotes: 160

Akshit Rewari
Akshit Rewari

Reputation: 941

In the menu bar

Select tools>-android>-SDK manager

and download the SDK build tools, SDK platform and Google API's( the Google API stores packages such as "import android.view.Menu" etc.) for the target SDK version of your project(20 as shown in your screenshot). if you are not sure which items you have to download , you can select all of them.(will take more time to download of course).

Restart the IDE

Upvotes: 19

Related Questions