The answer provided by @unify @GabrieleMariotti and @AndyJoiner is correct. However, this is confused, since we have two gradle files - the gradle project level and the internal gradle (where you write your dependencies). The solution is to add the code suggested by @AndyJoiner inside the internal gradle .
Since I was confused as to where to add the code, which took me an hour to understand, I do not want this to happen to others. So, I am sending my both gradle files.
Gradle project level
buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.0.0' } } allprojects { repositories { jcenter() } }
Inner gradle
apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.itcse.materialdesignsearchviewlikegoogleplay" minSdkVersion 15 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } // Add the code for repositories here repositories { mavenCentral() maven { url "https://oss.sonatype.org/content/repositories/snapshots" } maven { url 'http://guardian.github.com/maven/repo-releases' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.3' // Add the dependencies here compile 'com.quinny898.library.persistentsearch:library: 1.0.0-SNAPSHOT@aar ' }
Hope this helps others in the future.
source share