7

After upgrading IntelliJ IDEA to version 2021.1 (Ultimate) it fails to load gradle projects. It displays a message:

The Jdk installation is invalid.
Selected Jdk location is C:/Program Files/Java/jdk-11.0.3.

Select a JDK from the File System
Download JDK 8

The problem is that when I click "Select a JDK from the File System", a window with "Android SDK location" and "Android NDK location" appears. The projects are not for Android, so why is the IDE asking for Android libraries? And how to fix it?

(OS: Windows 10)

pkalinow
  • 1,619
  • 1
  • 17
  • 43

1 Answers1

10

Do you have local.properties file inside project root? See IDEA-266804. Will be fixed in next IDE update.

As a workaround, disable the Android plugin in Settings | Plugins or remove the local.properties file.

Andrey
  • 15,144
  • 25
  • 91
  • 187
  • I don't have local.properties in my projects. However, disabling Android plugin helps. Now, I can build projects with gradle, however IDE highlights the whole build.gradle.kts file, displaying a message that KotlinBuildScript class cannot be found. – pkalinow Apr 19 '21 at 07:13
  • Solution to the problem with script error is here: https://stackoverflow.com/questions/65645510/cannot-access-script-base-class-org-gradle-kotlin-dsl-kotlinbuildscript/67157853#67157853 – pkalinow Apr 19 '21 at 09:12