我使用的是捆绑在Android Studio中的Gradle构建系统。到目前为止,我能够使用存储在我的项目结构中的依赖项来构建多项目设置。我现在想使用maven依赖项,但无济于事。我写了一个非常简单的build.gradle的文件,总是失败:Maven依赖Android Studio/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.
它发生与到目前为止,我还没有尝试过任何神器。有什么不对?
感谢
http://mvnrepository.com/artifact/com.google.android/support-v4/r7 –
注意:您可以在http://mvnrepository.com/artifact/com.h2database/h2中获得最新版本 – mangu23