Failed to resolve: com.android.volley:volley:1.1.0

2019-05-07 05:31发布

'gradle' 'import' was done. Then I got a problem. Help.

D:\bg.jou\GanggoContacts\build.gradle

Error:(25, 13) 

Failed to resolve: com.android.volley:volley:1.1.0
<a href="openFile:D:/bg.jou/GanggoContacts_v34_insert_error/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

Error:(26, 13)

 Failed to resolve: com.github.bumptech.glide:glide:3.7.0
<a href="openFile:D:/bg.jou/GanggoContacts_v34_insert_error/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

not complete problem

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

dependencies {
    //compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.android.gms:play-services-gcm:11.8.0'
    compile fileTree(include: '*.jar', dir: 'libs')

    compile project(':fingerpush_3.0.7')
    compile 'com.android.volley:volley:1.1.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'
}

2条回答
霸刀☆藐视天下
2楼-- · 2019-05-07 05:52

Add this snippet to your build.gradle file,

allprojects {
    repositories {
        google()
        jcenter()
    }
}

and replace with this -

buildscript {
    repositories {
        google() // Just google() will be fine
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

If, you are using gradle version lower than 4.1 - replace
google()
with

maven {
    url 'https://maven.google.com'
}
查看更多
时光不老,我们不散
3楼-- · 2019-05-07 06:12

One of the solutions below must solve your problem:

1- If you've added the following line in your "module/app" build.gradle,

compile 'com.android.volley:volley:1.1.0'

you need to have the following code in your "project" build.gradle in order to enable your programming environment to find and download volley package

   allprojects {

    repositories {
         jcenter()
    }
}

2- You are living in a country which is under U.S. and International sanctions and that's why your programming environment cannot connect automatically to jcenter(bintray.com) to download the library, even though you've added jcenter to your repo list. If so, you have to use a proxy while syncing gradle.

查看更多
登录 后发表回答