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
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
this happen with me when I try import wrong repository
complie 'me.dm7.barcodescanner:zxing:1.7.2'
, so any one face this problem may be that be the reason
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
}
A complement to igor's anwswer: for me "Android Support Library" wasn't enough. You would probably like to add "Android Support Repository" also.
As he said:
don't forget Administrator rights ;)
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).