No IDEA annotations attached to the JDK 1.8 (C:\...), some issues will not be found

43,713

Solution 1

Solution

  • Close Android Studio
  • Go to C:\Users\UserName\.android and rename the build-cache folder to build-cache.bak
  • Go to C:\Users\UserName\.AndroidStudio3.2\system and rename these folders

    caches to caches.bak

    compile-server to compile-server.bak

    compiler to compiler.bak

    conversion to conversion.bak

    external_build_system to external_build_system.bak

    frameworks to frameworks.bak

    gradle to gradle.bak

    resource_folder_cache to resource_folder_cache.bak

  • Open the Android Studio and open your project again.

Solution 2

I have been working on 3.2.1 version since October 2018 (for 1 month).
But today I started my project in AndroidStudio with a many errors.

I tried to Invalidate Caches and Restart. But it doesn’t helped me.

So, I opened the folder C:\Users\{username}.
There I found three folders: one for the real version - .AndroidStudio3.2 and two for older versions - .AndroidStudio3.1 and .AndroidStudio2.3.

enter image description here

I could only delete the folder with the actual version, but I deleted all the folders. (Because I have no important user settings in AndroidStudio).

Then I restarted AndroidStudio, and I chose “Do not import settings”. Like this:

enter image description here

This method worked for me.

Solution 3

Go to File -> Invalidate Caches / Restart... -> Invalidate Caches and Restart

Solution 4

I am also stuck with this same issue since last week on 3.2.1 version.

What worked for me is to remove (or you can move it as a backup) the ".AndroidStudio3.2" (for you it will be .AndroidStudio3.1) folder located in "C:\Users{username}\" and then reopen the Android Studio.

While launching I selected to import settings from the last version and proceed. it will reconfigure all the settings.

Try that.

Solution 5

My answer might come late, but here is what fixed the issue for me:

  1. Turn off Android studio

  2. Open C:\Users\UserName\.android and rename the build-cache folder to build-cache.bak

  3. Open C:\Users\UserName.AndroidStudio3.2\system. Rename the files:

    • caches —> caches.bak
    • compiler —> compiler.bak
    • compile-server —> compile-server.bak
    • conversion —> conversion.bak
    • external_build_system —> external_build_system.bak
    • frameworks —> frameworks.bak
    • gradle —> gradle.bak
    • resource_folder_cache —> resource_folder_cache.bak
  4. Restart Android Studio; it will generate those folders again.

  5. After the success, delete the .bak files.

Share:
43,713
Morteza Baghalpoor
Author by

Morteza Baghalpoor

Updated on July 05, 2022

Comments

  • Morteza Baghalpoor
    Morteza Baghalpoor almost 2 years

    In Android Studio 3.1.2 I am suddenly getting the following message in a yellow tape frame at the top of my editor:

    No IDEA annotations attached to the JDK 1.8 (C:\Program Files\Android\Android Studio\jre), some issues will not be found

    I also have a warning in Edit Configurations:

    Default Activity not found

    How can I solve these issues?

  • Tom Rutchik
    Tom Rutchik over 5 years
    New update: It originally looked like the technique I described fixed the problem, but when I visited the project again this morning, the error message "No IDEA annotations attached to the JDK 1.8" has come back. I'm at a lost being able to explain what I observed. What I'm also seeing is that projects that didn't have this error message are all suddenly having this same error message.
  • Tom Rutchik
    Tom Rutchik over 5 years
    My last update: Levi Ricki Saptra solution seems to have solved the problem. His solution looks like to me to be a manual way to force all of cache to be cleared for all projects. You would think that Invalidate Cache / Restart would have been the equivalent of his solution, but that doesn't appear to be the case. Good job Levi!
  • Arie Agung
    Arie Agung over 5 years
    this also worked for android:xxxx unknown attribute error warning in layout file.
  • Louis
    Louis over 5 years
    It helps me a lot,thanks.I think this solve can work because some of these file was broken.When we rename the folder,AS will make a new folder(or download?not sure)
  • Levi Rizki Saputra
    Levi Rizki Saputra over 5 years
    This method actually renames that files so that Android Studio doesn't recognize it. This method is actually same as deleting that files. I renamed that files only to backup if an error occurred in Android Studio. So, you can solve the problem by deleting that files.
  • Mairyu
    Mairyu about 5 years
    when you say 'improperly displaying the contents of a file', by any chance, do you .java files look like XML files w/ totally different content ? This stumped me for weeks. I usually import my project from github and start over, VERY annoying and it keeps happening
  • Neelay Srivastava
    Neelay Srivastava about 5 years
    just remove the system folder from the current version and replace it with old version worked for me
  • Tom Rutchik
    Tom Rutchik almost 5 years
    Yeah, that's exactly what I saw!
  • sanevys
    sanevys almost 5 years
    Thank you, do you know what caused it?
  • Giulio Caccin
    Giulio Caccin over 4 years
    Can you please add some more information in case the link is not working?
  • Taki
    Taki over 4 years
    I have edited my answer and provided the steps i followed to solve my issue