首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NoClassDefFoundError怎么会突然发生?

NoClassDefFoundError怎么会突然发生?
EN

Stack Overflow用户
提问于 2019-04-27 13:07:42
回答 1查看 325关注 0票数 1

突然之间,在没有处理gradle文件的情况下,从一个编译到另一个编译,我得到了以下错误:

代码语言:javascript
复制
java.lang.RuntimeException: An error occured while executing doInBackground()

Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/stream/XMLInputFactory;

Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.xml.stream.XMLInputFactory" on path: DexPathList[[zip file "/data/app/com.vuzix.automation.dev-2/base.apk"],nativeLibraryDirectories=[/data/app/com.vuzix.automation.dev-2/lib/arm, /vendor/lib, /system/lib]]

Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
  1. 我试图禁用即时运行#无法工作
  2. 我试着删除应用程序,清理,重新编译#不工作
  3. 我甚至更新了DoAndroidStudio3.4和gradle类路径,以“com.android.tools.build:gradle:3.4.0”

我的分级档案:

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.vuzix.automation.dev"
        minSdkVersion 22
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
    maven {
        url "https://nexus-repository.snips.ai/repository/snips-maven-releases/"
    }
}
configurations {
    all*.exclude group: "xmlpull", module: "xmlpull"
    all*.exclude group: "org.apache.commons", module: "commons-compress"
    all*.exclude group: "com.thoughtworks.xstream", module: "commons-compress"
}

android {
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
}

dependencies {
    implementation 'com.vuzix:hud-actionmenu:1.1'
    implementation 'com.vuzix:hud-resources:1.1'
    implementation files('libs/core-1.58.0.0.jar')
    implementation files('libs/prov-1.58.0.0.jar')
    implementation files('libs/bcpkix-jdk15on-1.58.0.0.jar')
    implementation files('libs/prosys-opc-ua-sdk-client-server-evaluation-4.0.0-774.jar')
    implementation files('libs/slf4j-api-1.7.25.jar')
    implementation files('libs/slf4j-log4j12-1.7.7.jar')
    implementation files('libs/log4j-1.2.17.jar')
    implementation('ai.snips:snips-platform-android:0.62.3@aar') {
        transitive = true
    }


    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    ['boofcv-android', 'boofcv-core'].each {
        String a -> api group: 'org.boofcv', name: a, version: '0.31'
    }
    api fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    testImplementation 'junit:junit:4.12'
}

为什么会发生这种情况?

EN

回答 1

Stack Overflow用户

发布于 2019-04-27 17:27:48

我找到了解决这个问题的方法,尽管我还在想为什么它以前起作用了。

我下载了com.bea.stax.impl_1.2.0.jarstax-api-1.0-2.jar,并将它们放在libs文件夹中。然后在文件→项目结构→依赖项中添加jars。

清洁,建造,运行和运行,这是有效的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55880862

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档