I'm trying from yesterday to configure gradle to build Android project. I've got same error since then:
Failed to notify project evaluation listener. Could not resolve all dependencies for configuration ':_DebugCompile'. Could not find any version that matches com.android.support:support-v4:13.0.+.
The official fix on many sites is to install Android Support Repository. I have it installed already, but problem still occurs. I've run out of ideas what can be wrong here...
Here is full code:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5+'
}
}
apply plugin: 'android'
dependencies {
compile 'com.android.support:support-v4:13.0.+'
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aild.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
You need an additional block at the top level after your
apply pluginline:In general, you need a
repositoriesblock at the same level as anydependenciesblock (hence why you also need one in thebuildscriptblock).Most of the time, you'd move your
buildscriptblock to the top levelbuild.gradle(so that all your modules use the same gradle build) rather than have them both at the module level.