Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does IntelliJ IDEA 2021.1 require Android SDK for gradle projects?

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)

like image 429
pkalinow Avatar asked Apr 16 '21 13:04

pkalinow


People also ask

Do I need Android Studio if I have IntelliJ IDEA?

If I'm already a user of IntelliJ IDEA, do I need to switch to Android Studio for Android development? No. Android Studio is focused specifically on Android development and provides streamlined environment and project setup, but otherwise all of its features are available in IntelliJ IDEA.

Does IntelliJ have Android SDK?

IntelliJ IDEA contains all the features found in Android Studio. Setup for Android development is, however, a bit more involved since it does not include the Android SDK by default.

How does IntelliJ recognize Gradle project?

In the Gradle tool window, right-click a linked project. From the context menu, select Open Gradle config F4 . IntelliJ IDEA navigates to the appropriate Gradle configuration file and the related build.

What SDK do I need for IntelliJ?

To develop applications in IntelliJ IDEA, you need a Java SDK (JDK). A JDK is a software package that contains libraries, tools for developing and testing Java applications (development tools), and tools for running applications on the Java platform (Java Runtime Environment — JRE).


1 Answers

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.

like image 151
Andrey Avatar answered Oct 05 '22 09:10

Andrey