ProGuard未使用Windows中使用的Joda Time进行编译 [英] ProGuard didnt compile with Joda Time used in Windows
问题描述
实际上,这是一个答案,而不是一个问题: 我确实在Windows上使用JodaTime花费了很多时间,但是使用ProGuard将其包含在我的Android项目中
Actually this is an answer and not a question anymore: I did spent many hours on Windows using JodaTime to be included in my Android project using ProGuard
Proguard配置:
Proguard Configuration:
-libraryjars C:\Users\Reto\Documents\GitHub\advanceIT\LoveClockPAY\libs\joda-time-2.1.jar
我遇到以下错误:
-
ProGuard找不到我的JAR并说:
ProGuard didnt find my JAR and said:
Can't read [C:\Users\Reto\Documents\GitHub\advanceIT\LoveClockPAY\libs\joda-time-2.1.jar] (No such file or directory)
解决方案
-libraryjars libs/joda-time-2.1.jar
ProGuard不想编译并抛出很多这样的错误:
ProGuard didnt wanna compile and thrown many line of errors like this:
Warning: org.joda.time.base.AbstractDuration can't find referenced class org.joda.convert.ToString
解决方案
# Exclude those 2 dependency classes, cause otherwise it wont compile
-dontwarn org.joda.convert.FromString
-dontwarn org.joda.convert.ToString
推荐答案
或者作为问题2的解决方案,您可以添加 joda-convert-xxx.jar 中包含的实现.可以在joda-convert主页上找到
Or alternatively as solution for problem 2. you can add an implementation included in joda-convert-xxx.jar. It can be found on the joda-convert homepage
然后将以下行添加到您的proguard配置中:
Then just add a following line into your proguard configuration :
-libraryjars YOUR_DIR_WITHS_JARS/joda-convert-1.3.1.jar
这篇关于ProGuard未使用Windows中使用的Joda Time进行编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!