Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding iText 5.5.6 to Android project with gradle exception

I am trying to add the iTextPDF library to a Android project using Android Studio (gradle). I add the library with compile 'com.itextpdf:itextpdf:5.5.6' instruction but I am getting an error:

Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/opt/jdk1.7.0_79/bin/java'' finished with non-zero exit value 2

My build.gradle is:

apply plugin: 'com.android.application'

android {
 compileSdkVersion 22
 buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "josealopez.com.software"
    minSdkVersion 14
    targetSdkVersion 22
    versionCode 104
    versionName "1.0.4"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
packagingOptions {
    exclude 'META-INF/ASL2.0'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.couchbase.lite:couchbase-lite-android:1.0.4'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.google.android.gms:play-services:7.0.0'
compile 'com.itextpdf:itextpdf:5.5.6'
}
like image 397
Jose A Lopez Pastor Avatar asked Nov 25 '25 17:11

Jose A Lopez Pastor


1 Answers

I put these two dependencies in the gradle:

compile 'com.itextpdf:itext-pdfa:5.5.10'
compile 'com.itextpdf:itextg:5.5.9'
like image 183
Gonzalo León Avatar answered Nov 28 '25 06:11

Gonzalo León



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!