我使用的是捆綁在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