Hi guys,
I have an android project structure like this:
Application
|__Library1
|__Library2
|__<multiple JAR files>
Library2 does not have any code, it is just a container for 30 or so JAR
files. The problem is that Library1 and Application both need to compile
against <multiple JAR files> but also have <multiple JAR files> excluded in
the final APK. Is there any way to exclude JARs contained in a different
project during the dexing step? I have tried using configurations.provided
but with limited success. I am only able to get it to work if the project
structure looks likes this:
Application
|__Library1
|__<multiple JAR files>
Then the <multiple JAR files> do not get compiled into the final APK as
desired. I am only having problems when there are 2 levels of dependencies
in my project structure. Here are my build.gradle files.
<Application>
apply plugin: 'android'
configurations{
provided
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
provided project(':Library1')
}
android.applicationVariants.all { variant ->
variant.javaCompile.classpath += configurations.provided
}
<Library1>
apply plugin: 'android-library'
configurations{
provided
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
provided project(':Library2')
}
android.libraryVariants.all{ variant ->
variant.javaCompile.classpath += configurations.provided
}
<Library2>
apply plugin: 'android-library'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android.libraryVariants.all { variant ->
variant.packageLibrary.exclude( 'libs/*.jar' )
}
Any help would be appreciated. Thanks.
--
You received this message because you are subscribed to the Google Groups
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.