Could not find com.squareup.picasso:picasso:2.5.2

15,050

Solution 1

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()
    }
}

This will result in the following 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()
    }
}

Solution 2

According to their Github, you have to use MavenCentral to get their library so add this to your build.gradle(app) file:

repositories {
    mavenCentral()
}

Resync and try again.

Solution 3

In my case, I just set in the gradle.properties settings for https

systemProp.https.proxyHost=some.proxy.adress.com

systemProp.https.proxyPort=8080

so in my case, gradle.properties will be:

systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=8080
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=8080

Solution 4

You need to add a maven repository from which Picasso can be downloaded. You can do that by adding this in your app module's build.gradle file:

repositories {
    jcenter()
}

A good place would be just before your dependencies {} block.

Share:
15,050
Robbi Nespu
Author by

Robbi Nespu

Take benefit of five before five: - your youth before your old age, - your health before your sickness, - your wealth before your poverty, - your free-time before your preoccupation, - and your life before your death

Updated on June 21, 2022

Comments

  • Robbi Nespu
    Robbi Nespu almost 2 years

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

    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'
    
    }
    

    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
        }
    

    The error said:

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

    Any help are welcome.