Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ProGuard didnt compile with Joda Time used in Windows

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

like image 952
user1013443 Avatar asked Dec 24 '12 20:12

user1013443


1 Answers

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
like image 124
Michal Harakal Avatar answered Nov 10 '22 22:11

Michal Harakal