8

'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'
}
Zoe
  • 27,060
  • 21
  • 118
  • 148
최범규
  • 81
  • 1
  • 1
  • 4

4 Answers4

13

jcenter() is now deprecated.

Use this in build.gradle of app: 'com.android.volley:volley:1.2.0'

And this in build.gradle:

repositories {
    google()
    mavenCentral()
}
CodingChap
  • 1,088
  • 2
  • 10
  • 23
martinlacorrona
  • 131
  • 1
  • 4
7

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.

Mehdi
  • 71
  • 6
4

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'
}
Paresh P.
  • 6,677
  • 1
  • 14
  • 26
0

you probably need to force the project to use the latest version of volley

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/32773853) – abdo Salm Sep 26 '22 at 18:30