Android Studio suddenly cannot resolve symbols

后端 未结 28 2532
南笙
南笙 2020-11-22 04:42

Android Studio 0.4.2 was working fine and today I opened it and almost everything was red and the auto-completion had stopped working. I look at the imports and AS seems to

相关标签:
28条回答
  • 2020-11-22 05:04

    I got it solved by setting JDK. I got a pop up saying that Setup JDK when I placed mouse over the error.

    0 讨论(0)
  • 2020-11-22 05:04

    I use shared preferences, but Android Studio complained about Editor symbol. Then, I added

    import android.content.SharedPreferences.Editor;
    

    and symbol is cool now.

    0 讨论(0)
  • 2020-11-22 05:04

    I tried everything listed here. Then I checked my androidmanifest.xml I'd had some stoopid mismatched due to folder renames & package renames.

    0 讨论(0)
  • 2020-11-22 05:04

    I had a similar problem when I rebuilt an aar file and replaced the older one in my project with the new one. I went through all the solutions here and none solved my issue. I later realised that minifyEnabled had been set to true in the library project which effectively removed a lot of dead code that was not being used in the library project.

    My solution was to set minifyEnabled to false in the library project, assemble the aar, copied it into my project, invalidated caches and synced the grade project and everything worked fine.

    0 讨论(0)
  • 2020-11-22 05:08

    Android Studio 1.3

    1. Open Module Settings
    2. Click on your module under Modules menu
    3. In the properties tab, set the Source Compatibility and Target Compatibility to your java version.

    I did nothing else and it worked for me.

    0 讨论(0)
  • None of these methods helped me in Android Studio 0.5.8.

    My solution was to delete ~/.AndroidStudioPreview directory (in Ubuntu). Sorry, I have no idea where is it in other OS. This directory stores temporary files and Android Studio settings, so I missed all my settings. But it works!

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