I want to add an external library GuillotineMenu-Android in my application. I followed the steps given in the most upvoted answer to an existing question How do I add a library project to the Android Studio?
But I am facing error when I try to build project after step 6 i.e. when added dependency in app/build.gradle
as compile project(":guillotinemenu")
. I tried all the stackoverflow links related to this error but its not working out. I have made a folder named libs in my app directory and copied the project folder guillotine menu there. Here is my
build.gradle(Module:app)
file
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.sunshine.bbreaker.appet_i"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:recyclerview-v7:+'
compile 'com.github.navasmdc:MaterialDesign:1.+@aar'
compile 'com.android.support:appcompat-v7:22.0.+'
// GuillotineMenu
compile project(":guillotinemenu")
}
settings.gradle(Project Settings) file:
include ':app', ':guillotinemenu'
project(':guillotinemenu').projectDir = new File('libs/guillotinemenu')
build.gradle(Project:guillotinemenu) file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}} allprojects {
repositories {
jcenter()
}}
settings.gradle(Project:guillotinemenu) file:
include ':app', ':library'
build.gradle(guillotinemenu) file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.yalantis.guillotine.sample"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile project(':library')
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.jakewharton:butterknife:6.1.0'
}
Let me know if you need any more information. Thanks in advance.