Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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()
}
like image 747
CCS Avatar asked Dec 25 '22 08:12

CCS


2 Answers

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
    }
}
like image 83
Franco Avatar answered Dec 30 '22 11:12

Franco


Try using this:

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

like image 22
Rohit Arya Avatar answered Dec 30 '22 11:12

Rohit Arya