I am trying to add Volley to my android project in Android Studio. I downloaded Volley from git, and added it as a module using the Project Structure tool, as an android library. I fixed the errors regarding the build version an was able to compile with the new module added to my project. I started writing code and the Volley stuff even shows up in my auto complete and the packages were automatically added to my source file.
But when I compile, i get error: package com.android.volley does not exist
Does anyone know what my problem is?
here is my project structure:
here is my apps build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.loop"
minSdkVersion 15
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v13:20.0.0'
compile 'com.google.android.gms:play-services:4.4.+'
}
and settings.gradle:
include ':app', ':volley'
I had to add compile project(':volley')
to my dependencies under build.gradle
so final code is
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v13:20.0.0'
compile 'com.google.android.gms:play-services:4.4.+'
compile project(':volley')
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With