18

I'm trying to take a String and convert it to another String in a more readable format:

String startTime = invite.get_start_time();
Log.d(LOG_TAG, "String to be converted is " + startTime);
DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
DateTime dt = fmt.parseDateTime(startTime);
invite.set_start_time(dt.toString("MM dd yyyy hh:mmaa"));

08-02 14:33:19.011: D/InvitesObjectListAdapter(856): String to be converted is 2015-08-03 10:30:00 08-02 14:33:19.041: W/System.err(856): java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap" ClassLoader: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/me.lunchbunch.core-1/base.apk"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]]]

Anyone know where this error comes from?

SatyaTNV
  • 4,137
  • 3
  • 15
  • 31
Brandon
  • 1,886
  • 2
  • 17
  • 28
  • 3
    Did you initialize? See http://stackoverflow.com/questions/10743241/only-some-users-reporting-resource-not-found-error-does-this-make-sense – adelphus Aug 02 '15 at 18:39

1 Answers1

45

Sorry for wasting peoples' times, @adelphus is correct - I did not initialize with:

JodaTimeAndroid.init(this);

It was in my code, but I need to refactor to ensure this is hit.

Brandon
  • 1,886
  • 2
  • 17
  • 28
  • it's not necessary anymore to call init(): https://github.com/dlew/joda-time-android/blob/main/CHANGELOG.md#2109-2020-12-29 – mtrakal Jul 14 '22 at 12:13
  • So @mtrakal how you explain if I'm using v2.10.9.1 but currently having this error on unit tests env? java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap" ClassLoader: jdk.internal.loader.ClassLoaders$AppClassLoader@67424e82 at org.joda.time.tz.ZoneInfoProvider.openResource(ZoneInfoProvider.java:225) – erik.aortiz Mar 01 '23 at 23:45