2

I see a strange crash with next line:

java.lang.NoSuchMethodError: org.apache.commons.lang3.builder.EqualsBuilder.a

Yes, I use proguard to obfuscate but I don't see same crash on other devices that I have with me. As well I unpacked apk and see that this class with this method is present.

I have assumption:

  1. Someone is playing with apk
  2. Something weird with device - particularly with ClassLoader

Unfortunately I can not verify my assumptions since I don't have physical access to this device.

Maybe you have experienced such error or you have additional information that brings a light on the problem?

2

I've tried the -keep class solution and it worked, but it did get the APK method count higher in about 3K methods.

A better solution is

-keepnames class org.apache.commons.lang3.** { *; }

As it will keep the classes/methods names that you use, avoiding the crash, but will allow for the unused ones to be removed.

1
  • Cool! Accepting your answer now – Eugen Martynov Jun 2 '16 at 9:53
2

claim: I do not know the source of the problem.

I've encounter this issue and worked around it by telling ProGuard not to obfuscate Apache Commons lib.

-keep class org.apache.commons.lang3.** { *; }

5
  • Jose, thanks for answer. It is workaround indeed. Can you confirm that the issue fixed? Can you confirm that rest of the code doesn't produce same issue again? – Eugen Martynov Apr 10 '15 at 4:50
  • Eugen, I've only been able to test with one Xiaomi Device and all good. That said, I can not confirm if something equal or similar wont show again as I am not able to understand the root cause. – Jose Montes de Oca Apr 10 '15 at 6:09
  • Thanks a lot! What is device name? – Eugen Martynov Apr 10 '15 at 6:21
  • Accepting as temporary solution this answer and looking for cause and proper fix. Thanks Jose! – Eugen Martynov Apr 10 '15 at 7:52
  • Have you found a proper solution? I've the same problem, with Xiaomi Redmi and org.apache.commons.lang3.StringUtils.join. Keeping whole Apache Commons in APK is not a good solution and against the idea of ProGuard. – Pitel Feb 4 '16 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.