gpt4 book ai didi

android - Xerces + Gradle = preDexDebug 错误

转载 作者:行者123 更新时间:2023-12-03 04:39:40 26 4
gpt4 key购买 nike

我正在尝试将 spring-context 添加到 Android Studio 中的项目中。我必须引入 Xerces,以便 Spring 可以正确解析我的上下文文件,但这会导致此错误:

Execution failed for task ':app:preDexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1


gradlew assembleDebug说问题是:

trouble processing "javax/xml/XMLConstants.class"



然后添加了一个冗长而傲慢的演讲,说明为什么编译核心库是一件坏事。好的,那么我该如何解决这个问题?

一件不起作用的事情是试图排除有问题的模块:
compile ('xerces:xercesImpl:2.11.0') {
exclude module: 'xml-apis'
}

这导致了更广泛的编译错误。

另一件不起作用的事情是 following the instructions for this Gradle JarJar plugin ,这导致:

Could not find property 'preBuild' on task set.



我准备放弃并从头开始编写自己的解析器。有没有办法使这项工作?

最佳答案

Xerces 扩展了核心库 javax这导致了 problem在安卓中。

您可以通过使用 JarJar 之类的工具重新打包所需的类来克服这个问题。这已在 Xerces-for-Android 中完成。 ,其中包mf放置在“正常” Xerces 包之上。

关于android - Xerces + Gradle = preDexDebug 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29883278/

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