CCS
CCS

Reputation: 111

AndroidStudio can't find Volley

I cloned volley from git clone https://android.googlesource.com/platform/frameworks/volley and imported it as a new module in AndroidStudio, but I get the following error when syncing:

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

My build.gradle, in my app folder:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.cs169_au.volleytest1"
        minSdkVersion 22
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile 'com.android.support:design:23.2.0'
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.google.maps:google-maps-services:0.1.7'
    compile 'com.android.volley:volley.1.0.0'
}

repositories {
    mavenCentral()
}

Upvotes: 4

Views: 18078

Answers (9)

RohitK
RohitK

Reputation: 1494

In android studio go to File-> "Invalidate Caches / Restart" -> Press "Invalidate Restart" button.

Upvotes: 0

Kona Suresh
Kona Suresh

Reputation: 1854

I also suffered with the same problem and finally resolved the following way

we should specify the maven urls in the project level "build.gradle" file. Then it resolved for me

allprojects {
    repositories {
        maven { url 'http://repo1.maven.org/maven2' }
        maven { url 'http://jcenter.bintray.com' }
    }
}

Upvotes: 1

Purva
Purva

Reputation: 11

It is compile 'com.android.volley:volley:1.0.0'

and not compile 'com.android.volley:volley.1.0.0'

Instead of a dot use a colon.

Upvotes: 1

Franco
Franco

Reputation: 2761

Google's official Volley is hosted in JCenter, so you have to add jcenter() to repositories in the project's build.gradle:

allprojects {
    repositories {
        mavenCentral()
        jcenter() // Add this line
    }
}

Upvotes: 7

Tony
Tony

Reputation: 520

just change your dependencies orders or change buildToolsVersion to 24.0.3.

and then refresh.

Upvotes: 0

Rohit Arya
Rohit Arya

Reputation: 6791

Try using this:

compile 'com.mcxiaoke.volley:library:1.0.19'

Upvotes: 3

waqas ali
waqas ali

Reputation: 1238

Try this

compile 'eu.the4thfloor.volley:com.android.volley:2015.05.28'

Upvotes: -2

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75788

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

Open build.gradle and add volley support compile 'com.mcxiaoke.volley:library-aar:1.0.0' under dependencies section.

Finally

dependencies {
        compile 'com.mcxiaoke.volley:library-aar:1.0.0'//1.0.19
}

Then Clean-Rebuild-Sync Your Project .

Edit

Using SNAPSHOT

add this to repositories section in build.gradle

repositories {
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
    }

add this to dependencies section in build.gradle

compile 'com.mcxiaoke.volley:library:1.0.19-SNAPSHOT'

Courtesy goes to

https://github.com/mcxiaoke/android-volley

Upvotes: 1

Ankur1994a
Ankur1994a

Reputation: 2122

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

in android studio go to File->project structure-> modules->app-> dependencies click icon + in right corner then go to module dependency select Volley. if there is another dependencies name with volley remove that.

Hope it will works for you.

Upvotes: 1

Related Questions