user3125971 user3125971 - 1 year ago 345
Java Question

Android Studio: Build error after adding boilerpipe library

I am trying to use boilerpipe for parsing text. I copied boilerpipe-1.2.0.jar, nekohtml-1.9.13.jar and xerces-2.9.1.jar to lib folder and added them as library. But when i try to run the project i get a huge error. Here is its end portion-

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: Return code 1 for dex process

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Here is my app build.gradle

apply plugin: ''

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.example.pushpankar.reader"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner ""
multiDexEnabled true
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), ''

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('', {
exclude group: '', module: 'support-annotations'
compile ''
compile ''
testCompile 'junit:junit:4.12'
compile ''
compile files('libs/boilerpipe-1.2.0/lib/xerces-2.9.1.jar')
compile files('libs/boilerpipe-1.2.0/lib/nekohtml-1.9.13.jar')
compile files('libs/boilerpipe-1.2.0/boilerpipe-1.2.0.jar')

Here is the link to output with the --debug option pastebin

Answer Source

What is your JDK version you are using?

You have to use the same Java version or greater than the one that was used to compile the external jars (boilerpipe).


From the error log you posted it looks like the error is:

java.lang.IllegalArgumentException: bad utf-8 byte

and this error has been filled in the github issue tracking of the boilerpipe project:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download