ProGuard没有使用Windows中使用的Joda Time进行编译

use*_*443 8 android proguard jodatime class-reference

实际上这是一个答案而不是一个问题:我在Windows上花了很多时间使用JodaTime使用ProGuard将其包含在我的Android项目中

Proguard配置:

-libraryjars C:\Users\Reto\Documents\GitHub\advanceIT\LoveClockPAY\libs\joda-time-2.1.jar
Run Code Online (Sandbox Code Playgroud)

我有以下错误:

  1. ProGuard没有找到我的JAR并说:

    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

  2. ProGuard不想编译并抛出许多错误,如下所示:

    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

Mic*_*kal 4

或者作为问题 2 的解决方案。您可以添加joda-convert-xxx.jar中包含的实现。可以在joda-convert主页上找到

然后只需将以下行添加到您的 proguard 配置中:

-libraryjars YOUR_DIR_WITHS_JARS/joda-convert-1.3.1.jar
Run Code Online (Sandbox Code Playgroud)