我尝试嵌入Otto库,which exists at the Maven Central。Gradle无法解析otto库
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.3'
}
}
apply plugin: 'android'
dependencies {
compile 'com.google.android.gms:play-services:4.0.30'
compile 'com.android.support:support-v13:19.0.0'
compile 'com.squareup:otto:1.3.4'
}
但我得到异常:
A problem occurred configuring root project 'sample-project'.
> Failed to notify project evaluation listener.
> Could not resolve all dependencies for configuration ':_DebugCompile'.
> Could not find com.squareup:otto:otto:1.3.4.
Required by:
:sample-project:unspecified
我尝试刷新依赖(gradle --refresh-dependencies
),但它并不能帮助。
我不使用的IntelliJ(AndroidStudio)或Eclipse。 – eleven
对不起,我的错。我认为你做了,因为它看起来很像我在IntelliJ中看到的错误消息,也试图让Gradle依赖项正常工作。所以,如果你不使用Android Studio或Eclipse,我假设你正在编译等命令行? – Grimeh