gpt4 book ai didi

java.lang.NoClassDefFoundError : org. jsoup.Jsoup

转载 作者:行者123 更新时间:2023-12-01 09:28:37 27 4
gpt4 key购买 nike

我收到此错误:

    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

问题是并非所有 Android 版本都会出现此错误。例如,Android 6 运行良好,而 Android 4.3 会抛出此错误。有人可以帮我做什么吗?

我的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'
}

最佳答案

我已经找到解决办法了。我不知道为什么,但我已经包含了整个“play-services:8.4.0”。因此,我必须启用 multiDexEnabled,然后我得到了这个 NoClassDefFoundError。因此,如果没有 multiDexEnabled,一切都可以正常工作。

关于java.lang.NoClassDefFoundError : org. jsoup.Jsoup,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39642958/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com