how to overcome Android Studio cannot resolve symbol for android classes

AndroidAndroid Studio

Android Problem Overview


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

Android Solutions


Solution 1 - Android

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

Solution 2 - Android

https://stackoverflow.com/questions/21100688/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

Solution 3 - Android

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

Solution 4 - Android

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

It helped me

Solution 5 - Android

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

Solution 6 - Android

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

Solution 7 - Android

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

Select build>-clean project>

Solution 8 - Android

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).

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionIdobView Question on Stackoverflow
Solution 1 - AndroidPriyanthiView Answer on Stackoverflow
Solution 2 - Androidserv-incView Answer on Stackoverflow
Solution 3 - AndroidAkshit RewariView Answer on Stackoverflow
Solution 4 - AndroidAlbertView Answer on Stackoverflow
Solution 5 - AndroidGunreet KaurView Answer on Stackoverflow
Solution 6 - AndroidpedagogyfirstView Answer on Stackoverflow
Solution 7 - AndroidKaregyeya CalvinView Answer on Stackoverflow
Solution 8 - AndroidBuddyCarverView Answer on Stackoverflow