8

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

user1013443
  • 798
  • 1
  • 8
  • 17
  • fwiw on a simple app, the `-dontwarn` & `-libraryjars` result in the same APK file size, and both APKs work. So ignoring in this case is fine. Also, adding the extra jar file does not increase the output size (it shouldn't - I'm just confirming for future readers) – Richard Le Mesurier Oct 27 '13 at 13:17

1 Answers1

4

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
Michal Harakal
  • 1,025
  • 15
  • 21