Eugen Martynov
Eugen Martynov

Reputation: 20130

Xiaomi HM 1SW java.lang.NoSuchMethodError

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?

Upvotes: 2

Views: 2131

Answers (2)

tinsukE
tinsukE

Reputation: 940

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.

Upvotes: 2

Jose Montes de Oca
Jose Montes de Oca

Reputation: 879

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.** { *; }

Upvotes: 2

Related Questions