how to overcome Android Studio cannot resolve symbol for android classes

前端 未结 6 1490
小蘑菇
小蘑菇 2020-12-25 11:01

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 wer

相关标签:
6条回答
  • 2020-12-25 11:18

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

    Select build>-clean project>

    0 讨论(0)
  • 2020-12-25 11:22

    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
    0 讨论(0)
  • 2020-12-25 11:24

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

    It helped me

    0 讨论(0)
  • 2020-12-25 11:26

    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

    0 讨论(0)
  • 2020-12-25 11:32

    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

    0 讨论(0)
  • 2020-12-25 11:41

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

    0 讨论(0)
提交回复
热议问题