Invalid Gradle JDK configuration found?

后端 未结 7 1736
小蘑菇
小蘑菇 2020-12-29 18:12

I am very new in Android Studio. I have a problem with gradle. it says,

Error:Invalid Gradle JDK configuration found.
Platform SDK         


        
相关标签:
7条回答
  • 2020-12-29 18:38

    SIMPLE SOLUTION:

    1. Go to build.gradle and at the top there will be a message JDK missing
    2. Click on it and use JDK from the list (or download one if you don't have)
    3. Sync project

    THANKS :)

    0 讨论(0)
  • 2020-12-29 18:41

    Under Android Studio, select File > Project Structure > JDK location. Specify the JDK to the folder of your currently installed JDK. And specify the SDK location as well.

    0 讨论(0)
  • 2020-12-29 18:42

    If you want / need to, update your JDK installation to the version that you want to use.

    Next, find the version for your current JDK installation by running javac -version or java -version. Check that it is what you expect.

    Next, find the JDK installation directory:

    • It should be on your %PATH%.
    • By default it will be a subdirectory of "C:\Program Files\Java"' for example: "C:\Program Files\Java\jdk1.8.0_45"

    Next, start Android Studio, and go to the "File->Project Structure->JDK Location" preference page.

    The file path given by the preference should be the path to the JDK installation director that you identified above. If it isn't then update it.

    Notes:

    • Use the full pathname of the installation directory; e.g. "C:\Program Files\Java\jdk1.8.0_45".
    • Use a pathname, not a URL.
    0 讨论(0)
  • 2020-12-29 18:42

    The simple and easy way is

    Go To Your build.gradle(Module:app) At the top right corner you will find notification JDK is missing or download missing JDK Clik on that notification and download JDK and Sync Project.

    0 讨论(0)
  • 2020-12-29 18:46

    For me the problem appeared after updating IntelliJ to version 2020.2.1.

    Just solved it by going to Project Structure -> SDK. There I only had the Java jdk. I've added IntelliJ IDEA Platform Plugin SDK and that seems to have solved the problem. gradle loads just fine.

    0 讨论(0)
  • Same error i got when I install android studio on my pc . at the time of installation I have installed android sdk and android studio in different path so In project structure I have set my new sdk path . Still I got message of invalid jdk ...then I knew location of jdk ,again in project structure I have set my jdk path.It works.

    0 讨论(0)
提交回复
热议问题