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.
For this, you have to connect your PC to the internet and you have to open your Android studio. After opening your project click on the Sync Project with Gradle files option. This will automatically download the new Gradle files and will fix the issue which is caused by the Gradle files.
Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.
I too faced the same issue and after days of trouble I figured it out. Just check if Java is installed
java -version
Any version above JDK 6 is OK
open -a TextEdit ~/.bash_profile
export JAVA_HOME=$(/usr/libexec/java_home)
export JDK_HOME=$(/usr/libexec/java_home)
source ~/.bash_profile
Now try gradle sync now, you must be able to complete sync
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With