Issue
I am seeing a a couple of errors coming up on Crittercism (Crash reporting service) for my published Android app. The trace is the following:
0 java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap" ClassLoader: dalvik.system.PathClassLoader@45908320
1 at org.joda.time.tz.ZoneInfoProvider.openResource(ZoneInfoProvider.java:211)
2 at org.joda.time.tz.ZoneInfoProvider.<init>(ZoneInfoProvider.java:123)
3 at org.joda.time.tz.ZoneInfoProvider.<init>(ZoneInfoProvider.java:82)
4 at org.joda.time.DateTimeZone.getDefaultProvider(DateTimeZone.java:462)
5 at org.joda.time.DateTimeZone.setProvider0(DateTimeZone.java:416)
6 at org.joda.time.DateTimeZone.<clinit>(DateTimeZone.java:115)
7 at org.joda.time.chrono.GregorianChronology.<clinit>(GregorianChronology.java:71)
8 at org.joda.time.chrono.ISOChronology.<clinit>(ISOChronology.java:66)
9 at org.joda.time.base.BaseDateTime.<init>(BaseDateTime.java:61)
10 at org.joda.time.DateTime.<init>(DateTime.java:155)
Searching shows this this is usually a compiling problem (Usually that the Joda Time Library was not added to the build path or something), but then why would only about 4 users out of a couple thousand see this error?
My only guess is that someone is trying to decompile the app to pirate it (Its a fairly popular paid app), and sees this error when they incorrectly re-compiled. In that case I am glad they are seeing errors and I dont need to worry about this.
The other weird thing is that the code causing the problem was surrounded by a try/catch, which didnt seem to catch it:
try {
DateTime dt = new DateTime();
DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
return fmt.print(dt);
} catch (Exception e) {
//Report issue to Analytics service
}
Which to me, makes it seem even more unlikely that this error would show up on Crittercism, since it should've been caught. Can anyone explain this?
Solution
This can happen in the case you miss initialization:
JodaTimeAndroid.init(this);
Answered By - bearlysophisticated
Answer Checked By - David Goodson (JavaFixing Volunteer)