2

I am using ProGuard to obfuscate and shrink my app and everything seems to work fine for me and 99% of my users but once in a while I get a report from a user who isn't able to run my app at all. It crashes with the following pattern:

01-05 13:20:57.273 W/dalvikvm(22002): Class resolved by unexpected DEX: MyClass;(0x418d1200):0x1d3ef00 ref [Lorg/apache/commons/lang3/time/FastDateFormat;] Lorg/apache/commons/lang3/time/FastDateFormat;(0x418d1200):0x1d5ebf8
01-05 13:20:57.273 W/dalvikvm(22002): (MyClass; had used a different Lorg/apache/commons/lang3/time/FastDateFormat; during pre-verification)
01-05 13:20:57.273 W/dalvikvm(22002): Exception Ljava/lang/IllegalAccessError; thrown while initializing MyClass;

I replaced the actual class name with MyClass. Obviously I'm using Apache Commons Lang in my project and FastDateFormat seems to cause the problem. I can't reproduce the crash no matter what.

I read questions with similar problems but they all focused on the Maps API or the Support library and also occured unconditionally. My problem seems to appear for a very tiny fraction of my users and especially not me.

Any ideas?

Kirill Rakhman
  • 42,195
  • 18
  • 124
  • 148
  • Could you post full stack trace you got from Google Play Developer Console? –  Feb 21 '13 at 23:29
  • 1
    If I had to guess, the user is running a ROM (manufacturer or mod) that, for whatever reason, adds Commons Lang to its zygote and therefore to each process. Since you do not control the classpath on Android, the pre-loaded Commons Lang trumped your own copy, and there was some difference between the two implementations' worth of `FastDateFormat`. The workaround would be to copy `FastDateFormat` into your app, refactored into some other package. – CommonsWare Feb 21 '13 at 23:29
  • You're right, one user had a custom ROM installed but there was also one with a stock Samsung ROM. I am using other classes of the library, too, so it seems unpractical to copy all of them. Especially since they use internal references as well. – Kirill Rakhman Feb 22 '13 at 12:49

0 Answers0