简体   繁体   English

导出.apk时Joda时间和ProGuard错误

[英]Joda time and ProGuard error when exporting .apk

In Eclipse when I export my .apk and enable proguard I'm getting the following build errors: 在Eclipse中,当我导出我的.apk并启用proguard时,我收到以下构建错误:

[2014-07-10 04:13:30 - VirginMobile] Proguard returned with error code 1. See console
[2014-07-10 04:13:30 - VirginMobile] Warning: org.joda.convert.JDKStringConverter$9: can't find referenced class javax.xml.bind.DatatypeConverter
[2014-07-10 04:13:30 - VirginMobile] Warning: org.joda.convert.JDKStringConverter$9: can't find referenced class javax.xml.bind.DatatypeConverter
[2014-07-10 04:13:30 - VirginMobile] Warning: org.joda.convert.JDKStringConverter$9: can't find referenced class javax.xml.bind.DatatypeConverter
[2014-07-10 04:13:30 - VirginMobile]       You should check if you need to specify additional program jars.
[2014-07-10 04:13:30 - VirginMobile] Warning: there were 3 unresolved references to classes or interfaces.
[2014-07-10 04:13:30 - VirginMobile]          You may need to specify additional library jars (using '-libraryjars').
[2014-07-10 04:13:30 - VirginMobile] java.io.IOException: Please correct the above warnings first.
[2014-07-10 04:13:30 - VirginMobile]    at proguard.Initializer.execute(Initializer.java:321)
[2014-07-10 04:13:30 - VirginMobile]    at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-07-10 04:13:30 - VirginMobile]    at proguard.ProGuard.execute(ProGuard.java:86)
[2014-07-10 04:13:30 - VirginMobile]    at proguard.ProGuard.main(ProGuard.java:492)

Couldn't find a solution in any other threads. 无法在任何其他线程中找到解决方案。

I included both joda-time-2.3.jar and joda-convert-1.6.jar (which took away all but three errors). 我包括joda-time-2.3.jar和joda-convert-1.6.jar(除了三个错误之外的所有内容)。 Anyone know how to fix this? 有人知道怎么修这个东西吗?

Much appreciation. 非常欣赏。

The Joda class org.joda.convert.JDKStringConverter makes use of the Java API class javax.xml.bind.DatatypeConverter , which is not available in the Android API. Joda类org.joda.convert.JDKStringConverter使用Java API类javax.xml.bind.DatatypeConverter ,这在Android API中不可用。

Joda may still work on Android if you don't actually use the JDKStringConverter class, but ProGuard tries to ensure that all dependencies are fulfilled. 如果您实际上没有使用JDKStringConverter类,Joda可能仍然可以在Android上运行,但ProGuard会尝试确保满足所有依赖项。

You could try to tell ProGuard to ignore the missing dependency with the option "-dontwarn javax.xml.bind.DatatypeConverter". 您可以尝试通过选项“-dontwarn javax.xml.bind.DatatypeConverter”告诉ProGuard忽略缺少的依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM