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

前端 未结 5 1219
我寻月下人不归
我寻月下人不归 2021-01-13 04:52

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

This my build.gradle (module)

apply plugin: \'         


        
相关标签:
5条回答
  • 2021-01-13 05:27

    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()
        }
    }
    
    0 讨论(0)
  • 2021-01-13 05:28

    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
    
    0 讨论(0)
  • 2021-01-13 05:41

    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.

    0 讨论(0)
  • 2021-01-13 05:42

    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.

    0 讨论(0)
  • 2021-01-13 05:43

    Begins when I use the app,and just have a build (module) without build (app).

    After I add Picasso library appears Error: (line, column) Failed to resolve: com.squareup.picasso: Picasso: 2.5.2 Show in File || Show in Project Structure dialog

    as well as with the glide library

    and the solution is as it says (DenisGL) is added allprojects follows:

    allprojects {
        repositories {
            jcenter ()
        }
    }
    
    0 讨论(0)
提交回复
热议问题