Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid Gradle JDK configuration found. Open Gradle Settings

I'm trying to integrate Jetpack Compose in my project with Android Studio 4.2 and I am getting the following error in the IDE:

Invalid Gradle JDK configuration found. Open Gradle Settings

I also checked the settings below:

  • Android gradle plugin version: 4.2.0-alpha01
  • Gradle version: 6.5-rc-1

app/build.gradle:

composeOptions {         kotlinCompilerVersion "1.3.70-dev-withExperimentalGoogleExtensions-20200424"         kotlinCompilerExtensionVersion "0.1.0-dev13"     }     buildTypes {         release {             minifyEnabled false             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'         }     }     buildFeatures {         compose true     }     compileOptions {         sourceCompatibility JavaVersion.VERSION_1_8         targetCompatibility JavaVersion.VERSION_1_8     }     kotlinOptions {         jvmTarget = "1.8"     } 

Any idea?

like image 532
Nicolas Bourdin Avatar asked Jun 18 '20 12:06

Nicolas Bourdin


People also ask

How do I fix invalid gradle JDK configuration found open gradle settings?

The problem was solved by clicking in Android Studio, File -> Project Structure -> SDK Location. Under JDK location, enter the correct directory for JDK, for example, /usr/lib/jvm/jdk1. 8.0_45. Click OK.

What is gradle Android?

Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app.


1 Answers

I got this issue in Android studio 4.2 canary, and I had to delete those generated files:

  • .idea/gradle.xml
  • .idea/workspace.xml

then clicking try again to sync the project.

like image 141
Mohamed Ibrahim Avatar answered Sep 17 '22 14:09

Mohamed Ibrahim