I want to use the Apache directory lib in my android application, according to their site all you need is to add the org.apache.directory.api:api-all dependency in maven. By using Maven repository I got the following gradle equivalent:
apply plugin: 'com.android.application'
buildscript {
repositories {
maven {
url 'https://mvnrepository.com/artifact/org.apache.directory.api/api-all';
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile group: 'org.apache.directory.api', name: 'api-all', version: '1.0.0-RC1'
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.msi.myapplication"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
preDexLibraries = false
javaMaxHeapSize "4g"
}
}
When running the library downloads, but when running it gives the error:
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_25\bin\java.exe'' finished with non-zero exit value 1
I have tried to clean and rebuild the project, I also manually deleted all the build files. Futhermore, I have tried with and without the: multiDexEnabled true and the dexOptions. This gives the same error. I have also tried extracting the all the jars into one jar file and include this into the project. This gives:
com.android.build.transform.api.TransformException
The question is quick and easy, how can I add the Apache Directory lib to my project in any way?