简体   繁体   English

无法使用MavenCentral在Gradle中解析库

[英]Cannot resolve library in gradle with mavenCentral

I am building a android application with gradle in Android Studio, and i have a dependency jackson-databind , but i get a error can't resolve xxx , even i use my private repo and i sure that library is there. 我正在用Android Studio中的gradle构建一个android应用程序,并且我有一个依赖jackson-databind ,但是我得到了一个can't resolve xxx的错误,即使我使用了我的私有仓库并且我也确定该库在那里。

apply plugin: 'com.android.application'

repositories {
    mavenCentral()
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:recyclerview-v7:25.0.0'
    compile 'com.android.support:cardview-v7:25.0.0'
    compile 'com.fasterxml.jackson.core:jackson-core:2.8.1'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.1'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.8.1'
    testCompile 'junit:junit:4.12'
}

And i get a error. 而且我得到一个错误。 在此处输入图片说明

我将gradle更新为3.2,它运行良好。

听起来您可能只需要同步build.gradle文件,请单击此图像中的“立即同步”,如下所示: https ://postimg.org/image/v0yro39cl/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM