I am using google's volley
lib in a project. I added it as a module, but during compilation it gives following error.
Here is the directory structure :
I tried adding
// testing
testCompile 'org.robolectric:robolectric:2.4'
testCompile 'junit:junit:4.+'
to the app's build.gradle
, but that didn't help.
So the obvious question is how to make it work?
UPDATE:
Volley's build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0+'
// testing
testCompile 'org.robolectric:robolectric:2.4'
testCompile 'junit:junit:4.+'
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 19
buildToolsVersion = '21.1.0'
}
apply from: 'rules.gradle'
App's build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.example.vjdhama.project"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile project(":volley")
}
ERROR :
/home/vjdhama/Documents/Coding/Android/project/volley/build.gradle
Error:Error:line (18)Gradle DSL method not found: 'testCompile()'
Possible causes:<ul><li>The project 'project' may be using a version of Gradle that does not contain the method.
<a href="openGradleSettings">Gradle settings</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>