Skip to content Skip to sidebar Skip to footer

Bizarre Behaviour When Using Apache Commons Lib In Android

I'm using commons-lang3-3.0.1.jar, in order to utilise the StrSubstitutor class. Check this out... The following code is called in from my SyncAdapter, it crashes constructing the

Solution 1:

Your crash is in the static initializer of StringUtils where it attempts to get the context class loader from the current thread - in an apparent attempt to obtain the java.text.Normalizer$Form class. So yes, it's some funky issue with getContextClassLoader() returning null.

Update

The error is apparently mentioned in this bug, so I guess you could just forcibly set the context class loader and you should be fine.

Thread.currentThread().setContextClassLoader(this.getClassLoader());

Post a Comment for "Bizarre Behaviour When Using Apache Commons Lib In Android"