ProGuard didnt compile with Joda Time used in Windows

你。 提交于 2019-12-08 19:23:04

问题


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 Configuration:

-libraryjars C:\Users\Reto\Documents\GitHub\advanceIT\LoveClockPAY\libs\joda-time-2.1.jar

I had the following errors:

  1. 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)

    Solution

    -libraryjars libs/joda-time-2.1.jar

  2. 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

    Solution

    # Exclude those 2 dependency classes, cause otherwise it wont compile

    -dontwarn org.joda.convert.FromString

    -dontwarn org.joda.convert.ToString


回答1:


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

Then just add a following line into your proguard configuration :

-libraryjars YOUR_DIR_WITHS_JARS/joda-convert-1.3.1.jar


来源:https://stackoverflow.com/questions/14025487/proguard-didnt-compile-with-joda-time-used-in-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!