Reputation: 31
i got this error:
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:299)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
at java.util.concurrent.FutureTask.run(FutureTask.java:239)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:849)
Caused by: java.lang.NoClassDefFoundError: org.jsoup.Jsoup
the problem is that not all Android version get this error. For example Android 6 works well whereas Android 4.3 throws this error. Could somebody help me what to do?
my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId 'com.test'
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:support-v4:23.2.1'
compile 'se.simbio.encryption:library:1.2.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile files('libs/jsoup-1.9.2.jar')
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
}
Upvotes: 0
Views: 871
Reputation: 31
I have found a solution. I don´t know why but I had included the whole 'play-services:8.4.0'. Because of that I had to enable multiDexEnabled and with that I got this NoClassDefFoundError. So without multiDexEnabled everything works.
Upvotes: 1
Reputation: 337
Could you try without adding this line compile files('libs/jsoup-1.9.2.jar')
? And send me a feedback ?
Upvotes: 0