Open kevinslashslash opened 3 years ago
Relevant stack trace
java.util.MissingResourceException: Can't find resource for bundle org.ocpsoft.prettytime.i18n.Resources, key ePattern
at java.util.ResourceBundle.getObject(ResourceBundle.java:445)
at java.util.ResourceBundle.getObject(ResourceBundle.java:439)
at java.util.ResourceBundle.getString(ResourceBundle.java:402)
at org.ocpsoft.prettytime.i18n.Resources_de$DeTimeFormat.<init>(Resources_de:141)
at org.ocpsoft.prettytime.i18n.Resources_de.getFormatFor(Resources_de:133)
at org.ocpsoft.prettytime.impl.ResourcesTimeFormat.setLocale(ResourcesTimeFormat:52)
at org.ocpsoft.prettytime.impl.ResourcesTimeFormat.setLocale(ResourcesTimeFormat:15)
at org.ocpsoft.prettytime.PrettyTime.registerUnit(PrettyTime:1473)
at org.ocpsoft.prettytime.PrettyTime.addUnit(PrettyTime:1613)
at org.ocpsoft.prettytime.PrettyTime.initTimeUnits(PrettyTime:1597)
at org.ocpsoft.prettytime.PrettyTime.<init>(PrettyTime:98)
at org.ocpsoft.prettytime.PrettyTime.<init>(PrettyTime:86)
Same issue
Happy to accept a PR for these issues. Thanks!
The bundled proguard rules only keep
org.ocpsoft.prettytime.i18n
but some ResourceBundle classes rely onTimeUnit.getClass().getSimpleName()
which are inorg.ocpsoft.prettytime.units
and thus allowed to be renamed by proguard.For example https://github.com/ocpsoft/prettytime/blob/3c2206d5b909b33354f9c09a8053a08b5ac93954/core/src/main/java/org/ocpsoft/prettytime/i18n/Resources_de.java#L133
Solutions I can think of are Refactor code to not use
TimeUnit.getClass().getSimpleName()
, it looks likeResourcesTimeUnit.getResourceKeyPrefix()
is appropriate but it's not on TimeUnit directly Update proguard rules to keepnames fororg.ocpsoft.prettytime.units
, this is easiest to do but feels less than idea. It also slightly feels like it's covering up a deeper problem.