Gradle in Android Studio giving error Project sync failed

后端 未结 10 1910
野性不改
野性不改 2020-12-11 04:09

I am new to Android Studio.I installed Android Studio-1.2.1.1 and i have jdk1.7.0_40 installed.I am facing problem with gradle build. For reference you can check gradle issu

相关标签:
10条回答
  • 2020-12-11 04:24

    Solved this by going to File -> Project Structure -> SDK Location

    and under JDK Location, update with Gradle SDK location.

    0 讨论(0)
  • 2020-12-11 04:30

    EDIT: I fixed this issue by uninstalling all the jdk installation & updates then reinstall only one jdk and assure its env. variables


    I do not have a solution but I have the same problem it happens as the android studio opens from java_home/jre thence all JVMs that will fork next will come from this path, while your system varible tells Gradle to get his java.exe from JAVA_HOME

    I tried to make gradle read from jre but it falied also i tried to make android studio open from java_home/bin but it falid also

    0 讨论(0)
  • 2020-12-11 04:32

    I solved it by going to Project Structure then unchecking use embedded JDK and then setting the path to C:\Program Files\Java\jdk1.8.0_121

    0 讨论(0)
  • 2020-12-11 04:33

    This is a very late answer but I see that a common suggestion is to remove all other jdk's and this is not always the best idea. You might need older jdk's for different projects. You can go into the gradle.properties file for the project and enter the following line (varied based on your version):

    org.gradle.java.home=C:/Java/jdk1.8.0_111
    

    If you are using a different jdk just point to a different directory.

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