Android Studio 0.8.2 - Gradle project sync failed

后端 未结 10 749
轮回少年
轮回少年 2021-01-17 09:51

In hindsight I should not have enabled L build stuff.

I am new to programming and I created a new Android Studio project which is throwing the Gradle errror right aw

10条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-17 10:19

    I too faced the same issue and after days of trouble I figured it out. Just check if Java is installed

    • Open a Terminal window and type:

    java -version

    Any version above JDK 6 is OK

    • In terminal type

    open -a TextEdit ~/.bash_profile

    • Copy and paste the following lines of into textedit

    export JAVA_HOME=$(/usr/libexec/java_home)

    export JDK_HOME=$(/usr/libexec/java_home)

    • Save it, close editor and type the following to apply changes

    source ~/.bash_profile

    Now try gradle sync now, you must be able to complete sync

提交回复
热议问题