Android - can't export apk with Proguard, when using Joda Time

android, jodatime, proguard

Solution

Ok I figured it out. Actually adding joda-convert.jar to build path works, but only for older version (1.4 and lower, if you download latest one - 1.5 joda-convert.jar, it doesn't work)...

Problem

I use joda-time.jar in my app, and when exporting signed apk proguard saying something like (it is pretty common problem as I can see, when I look over internet): ``` [2014-01-07 12:44:53 - XYZ] Proguard returned with error code 1. See console [2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.DateMidnight: can't find referenced class org.joda.convert.FromString [2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.DateTime: can't find referenced class org.joda.convert.FromString [2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.Days: can't find referenced class org.joda.convert.FromString ... [2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.Years: can't find referenced class org.joda.convert.FromString [2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.Years: can't find referenced class org.joda.convert.ToString [2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.base.AbstractDuration: can't find referenced class org.joda.convert.ToString [2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.base.AbstractInstant: can't find referenced class org.joda.convert.ToString [2014-01-07 12:44:53 - XYZ] Warning: org.joda.time.base.AbstractPeriod: can't find referenced class org.joda.convert.ToString [2014-01-07 12:44:53 - XYZ] You should check if you need to specify additional program jars. [2014-01-07 12:44:53 - XYZ] Warning: there were 37 unresolved references to classes or interfaces. [2014-01-07 12:44:53 - XYZ] You may need to specify additional library jars (using '-libraryjars'). [2014-01-07 12:44:53 - XYZ] java.io.IOException: Please correct the above warnings first. [2014-01-07 12:44:53 - XYZ] at proguard.Initializer.execute(Initializer.java:321) [2014-01-07 12:44:53 - XYZ] at proguard.ProGuard.initialize(ProGuard.java:211) [2014-01-07 12:44:53 - XYZ] at proguard.ProGuard.execute(ProGuard.java:86) [2014-01-07 12:44:53 - XYZ] at proguard.ProGuard.main(ProGuard.java:492) ``` Everywhere in forums or also here (Android - Proguard didn't compile with Joda Time jar file) they say solution should be downloading joda-convert.jar, adding to buildpath. But for me it just DOESN'T WORK, after I did it, proguard again says something similar: ``` [2014-01-07 12:41:39 - XYZ] Proguard returned with error code 1. See console [2014-01-07 12:41:39 - XYZ] Warning: org.joda.convert.JDKStringConverter$9: can't find referenced class javax.xml.bind.DatatypeConverter [2014-01-07 12:41:39 - XYZ] Warning: org.joda.convert.JDKStringConverter$9: can't find referenced class javax.xml.bind.DatatypeConverter [2014-01-07 12:41:39 - XYZ] Warning: org.joda.convert.JDKStringConverter$9: can't find referenced class javax.xml.bind.DatatypeConverter [2014-01-07 12:41:39 - XYZ] You should check if you need to specify additional program jars. [2014-01-07 12:41:39 - XYZ] Warning: there were 3 unresolved references to classes or interfaces. [2014-01-07 12:41:39 - XYZ] You may need to specify additional library jars (using '-libraryjars'). [2014-01-07 12:41:39 - XYZ] java.io.IOException: Please correct the above warnings first. [2014-01-07 12:41:39 - XYZ] at proguard.Initializer.execute(Initializer.java:321) [2014-01-07 12:41:39 - XYZ] at proguard.ProGuard.initialize(ProGuard.java:211) [2014-01-07 12:41:39 - XYZ] at proguard.ProGuard.execute(ProGuard.java:86) [2014-01-07 12:41:39 - XYZ] at proguard.ProGuard.main(ProGuard.java:492) ``` How to fix this issue? I spend few hours of trying everything, but I just can't find it out...Many thanks!

Original source

Related problems