我正在使用与 Android Studio 捆绑的 Gradle 构建系统。到目前为止,我能够使用存储在我的项目结构中的依赖项来构建多项目设置。我现在想使用 Maven 依赖项,但无济于事。我写了一个非常简单的 build.gradle 文件,但总是失败:
buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
dependencies {
compile 'com.google.android:support-v4:r7'
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
带有以下消息:
* What went wrong:
A problem occurred configuring project ':absabs'.
> Failed to notify project evaluation listener.
> Could not resolve all dependencies for configuration ':absabs:compile'.
> Could not find com.google.android:support-v4:r7.
Required by:
absabs:absabs:unspecified
....
Caused by: org.gradle.api.internal.artifacts.ivyservice.ModuleVersionNotFoundException: Could not find com.google.android:support-v4:r7.
到目前为止,我尝试过的任何工件都会发生这种情况。知道有什么问题吗?
谢谢