Monday, 9 October 2017

Android Studio 0.8.2 - Gradle project sync failed

itemprop="text">

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 comments but did not find much I could make sense of except for href="https://stackoverflow.com/questions/22148584/android-studio-gradle-sync-project-failed">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.



Answer




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



No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...