java - proguard 和 jdom 错误编译 android APK

标签 java android proguard geonames

我无法创建 Android 应用程序的版本,因为我正在使用 geonames 和 jdom。 jdom 给出了这个错误:

[2013-07-02 19:52:56 - <appname>] Proguard returned with error code 1. See console

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath$NSContext: can't find superclass or interface org.jaxen.SimpleNamespaceContext

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.JDOMException: can't find referenced class java.rmi.RemoteException

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.JDOMException: can't find referenced class java.rmi.RemoteException

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.BaseXPath

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.JaxenException

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.SimpleVariableContext

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.jdom.JDOMXPath

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.jdom.JDOMXPath

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.BaseXPath

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.BaseXPath

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.BaseXPath

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.BaseXPath

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.BaseXPath

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.BaseXPath

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.SimpleVariableContext

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.BaseXPath

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.BaseXPath

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.jdom.JDOMXPath

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.JaxenException

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.JaxenException

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.JaxenException

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath: can't find referenced class org.jaxen.JaxenException

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath$NSContext: can't find referenced class org.jaxen.SimpleNamespaceContext

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath$NSContext: can't find referenced class org.jaxen.SimpleNamespaceContext

[2013-07-02 19:52:56 - <appname>] Warning: org.jdom.xpath.JaxenXPath$NSContext: can't find referenced class org.jaxen.SimpleNamespaceContext

[2013-07-02 19:52:56 - <appname>]       You should check if you need to specify additional program jars.

[2013-07-02 19:52:56 - <appname>] Warning: there were 25 unresolved references to classes or interfaces.

[2013-07-02 19:52:56 - <appname>]          You may need to specify additional library jars (using '-libraryjars').

[2013-07-02 19:52:56 - <appname>] java.io.IOException: Please correct the above warnings first.

[2013-07-02 19:52:56 - <appname>]   at proguard.Initializer.execute(Initializer.java:321)

[2013-07-02 19:52:56 - <appname>]   at proguard.ProGuard.initialize(ProGuard.java:211)

[2013-07-02 19:52:56 - <appname>]   at proguard.ProGuard.execute(ProGuard.java:86)

[2013-07-02 19:52:56 - <appname>]   at proguard.ProGuard.main(ProGuard.java:492)

最佳答案

JDOM 版本 1.x 未在 Android 上得到官方支持(尽管它们可能有效)。 JDOM 2.x versions are supported (有一些限制)。

您遇到的问题是您没有移植 jaxen library到你的安卓系统。您需要确保您的项目包含 jazen jar,否则您对 JDOM XPath 的类依赖项将无法工作。

请注意,在 JDOM 2.x 中有一个 better API for XPath queries .

关于java - proguard 和 jdom 错误编译 android APK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17430455/

相关文章:

java - 在 Jenkins 中使用 Maven 解析 POM 文件时出错

java - 使用 ProGuard 进行混淆后 jar 无法运行

android - 选择 Release模式时应用程序崩溃但在 Debug模式下运行完美

java - 使用年份和不同的亚秒位数解析 LocalDateTime

java - JComboBox在java中的定位

android - 将代码从 Android 的 MainActivity 类移动到它们自己的库或文件

java - 在 Android 开发者网站上使用蓝牙示例代码时出现错误

具有多种外设的Android配件模式

android - android中的logback和代码混淆

java - 在循环内创建准备好的语句