Skip to content

Instantly share code, notes, and snippets.

@ikai
Created June 10, 2013 23:54
Show Gist options
  • Save ikai/5753491 to your computer and use it in GitHub Desktop.
Save ikai/5753491 to your computer and use it in GitHub Desktop.
TIL: to get Gradle to use external Maven dependencies, you need to declare repositories OUTSIDE 'buildscript'. If you don't, you get an error telling you Gradle can't resolve whatever external dependencies your project depend on.
buildscript {
repositories {
maven {
url 'http://repo1.maven.org/maven2'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
repositories {
maven {
url 'http://google-api-client-libraries.appspot.com/mavenrepo'
}
maven {
url 'http://repo1.maven.org/maven2'
}
}
apply plugin: 'android'
dependencies {
// compile files('libs/android-support-v4.jar')
compile 'com.android.support:support-v4:13.0.0'
compile 'com.google.android.gms:play-services:3.1.36'
compile 'com.google.http-client:google-http-client-jackson2:1.13.1-beta'
compile 'com.google.apis:google-api-services-youtube:v3-rev24-1.13.2-beta'
compile 'com.google.oauth-client:google-oauth-client-jetty:1.13.1-beta'
}
android {
compileSdkVersion 17
buildToolsVersion "17"
defaultConfig {
minSdkVersion 8
targetSdkVersion 16
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment