Android Studio 0.8.2 - Gradle project sync failed

2020-04-02 07:49发布

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 away.

Errors are:

yellow bar at the top - Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly. Try again Open Event Log Show Log in Finder

messages gradle sync - compileSdkVersion android-L requires compiling with JDK-7. open sdk settings, open file.

tried looking through google and other stack overflow comments but did not find much I could make sense of except for Android Studio - Gradle sync project failed

tried converting URL to 1.10 instead of 1.12 and syncing but that failed after syncing

I need help either getting L working or removing it so that a new studio project can compile to device without errors.

10条回答
在下西门庆
2楼-- · 2020-04-02 08:29
  1. Open Gradle Settings in File > Settings > Gradle
  2. Select the Option 'Use local gradle distribution'
  3. Enter the URL of your local gradle version here.
查看更多
成全新的幸福
3楼-- · 2020-04-02 08:29

Mine was looking for the Java SDK in "Macintosh_HD>System>Library>Java> etc." but my most recent update was in "Macintosh_HD>Library>Java etc."

I set this after clicking in the error window saying 'open SDK' 'open file' which brings you to the screen where to set the path for Java.

查看更多
男人必须洒脱
4楼-- · 2020-04-02 08:30

The most simple solution (at least for me) would be:

Go to SDK manager (with Administrator rights), scroll down till the end, download "Android Support Library".

And it works (don't forget Administrator rights).

查看更多
萌系小妹纸
5楼-- · 2020-04-02 08:34

When installing Android Studio on Mac OSX Sierra, I received an error that my JVM is not valid. So I came here to a different post and installed Apple's legacy version and the up-to-date version. It worked. Then when I was creating a project I ran into another error which was the Gradle sync issue. Came here (this very post by "Mac") again and changed the JDK version that Android Studio was pointing to (obviously I chose to "detect" instead of browsing for the up-to-date version). Everything is working fine now.

查看更多
登录 后发表回答