5

When running my Project, I get this error:

Error:Invalid Gradle JDK configuration found. <a href='#open_external_system_settings'>Open Gradle Settings</a> 
Platform SDK does not point to valid JDK (C:/Program Files/Java/jdk1.7.0_71)

To fix this I tried setting my javahome in gradle.build as

:findJavaFromJavaHome set JAVA_HOME=C:\Data\jdk1.7.0_55  set JAVA_EXE=%JAVA_HOME%/bin/java.exe

Still I get the same error. Can someone help pls.

nikis
  • 11,166
  • 2
  • 35
  • 45
Prabhuraj
  • 928
  • 2
  • 8
  • 14
  • Have you tried clearing C:\Users\\\system\caches after changing SDK, seem to solve the issue for me. – Kai Apr 09 '15 at 07:40

1 Answers1

9

I had this same problem recently.

First make sure your Android Studio is updated.

Then, in the error center, it directs you to a pop-up window which you have to choose between "Local Gradle" and "Recommended Gradle wrapper" (Sorry if names doesn't exactly match since it was while ago)

For me it was set on Local Gradle and I changed it to the "recommended" one and waited so it rebuild the project. After it was done, the errors went away for second and I saw the same error and when I opened that window again, I saw it is set on "Local Gradle" again, although I chose the recommended one.

So I did chose recommended again and this time it was fixed and stayed fixed and I had no problem anymore!

Hope it works for you

UPDATE If the above way doesn't work, it should be because u have recently updated your Java. so see this question and change the path of your Java SDK

Community
  • 1
  • 1
Sam Ramezanli
  • 998
  • 9
  • 20