找不到 com.squareup.picasso:picasso:2.5.2 [英] Could not find com.squareup.picasso:picasso:2.5.2

查看:31
本文介绍了找不到 com.squareup.picasso:picasso:2.5.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了 picasso 依赖项,但似乎不起作用.我尝试更改版本.但还是没用.

I adding picasso dependencies but seem it not worked. I tried changing the version. But still useless.

这是我的 build.gradle(模块)

This my build.gradle (module)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'

    defaultConfig {
        applicationId "bhouse.travellist_starterproject"
        minSdkVersion 21
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:recyclerview-v7:23.4.0'
    compile 'com.android.support:cardview-v7:23.4.0'
    compile 'com.android.support:palette-v7:23.4.0'
    compile 'com.squareup.picasso:picasso:2.5.1'

}

这是我的 build.gradle(项目)

and this is my build.gradle (project)

// Top-level build file where you can add configuration options common to all sub-projects/modules.
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
    }

错误说:

错误:(27, 13) 无法解析:com.squareup.picasso:picasso:2.5.1在文件中显示
在文件中显示项目结构对话框

Error:(27, 13) Failed to resolve: com.squareup.picasso:picasso:2.5.1 Show in File
Show in Project Structure dialog

欢迎任何帮助.

推荐答案

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

You need to add a section allprojects at the end of your main build.gradle that defines the repositories for the modules of your project:

allprojects {
    repositories {
        jcenter()
    }
}

这将导致以下 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()
    }
}

这篇关于找不到 com.squareup.picasso:picasso:2.5.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆