【问题标题】:unable to Add library to Android无法将库添加到 Android
【发布时间】:2019-11-07 16:39:17
【问题描述】:

当我想将库添加到 Android 时出现此错误:

implementation 'com.squareup.picasso:picasso:2.71828'



 ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.squareup.picasso:picasso:2.71828.
    Show Details
    Affected Modules: app

我得到了这个链接,但没有得到答案: Unable to resolve dependency Android Studio 3.0

【问题讨论】:

  • 更新您的构建工具,然后尝试文件> 使缓存无效/重新启动

标签: android


【解决方案1】:

您需要在主 build.gradle 的末尾添加一个 allprojects 部分,用于定义项目模块的存储库: build.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

希望这会对你有所帮助。

【讨论】:

    猜你喜欢
    • 2019-05-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-25
    • 1970-01-01
    • 1970-01-01
    • 2014-01-31
    • 1970-01-01
    相关资源
    最近更新 更多