I have a project that uses a few other library projects (SlidingMenu, ActionbarSherlock) and both of these use the android support library, when building I am getting the fo
Based in the answer from Xav, if you have other modules that depends on android-support-v4.jar, create a library project which contains the android-support-v4.jar and reference this project instead the jar file.
E.g.:
Add a project with this structure:
- android-support
- libs
- android-support-v4.jar
- AndroidManifest.xml
- build.gradle
AndroidManifest.xml:
build.gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4.2'
}
}
apply plugin: 'android-library'
dependencies {
compile files ("libs/android-support-v4.jar")
}
android {
compileSdkVersion 17
buildToolsVersion "17"
defaultConfig {
minSdkVersion 7
targetSdkVersion 7
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
}
}
}
remember to include this project in your projects settings.gradle:
include ':android-support'
now, for each project that requires the support library, instead of
compile files ("libs/android-support-v4.jar")
use the following line:
compile project (':android-support')