Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoSuchMethodError: No static method decodeHex(Ljava/lang/String;)[B in class Lorg/apache/commons/codec/binary/Hex; or its super classes (declaration of 'org.apache.commons.codec.binary.Hex' appears in /system/framework/org.apache.http.legacy.boot.jar) #52

Open
piyushyadavNP opened this issue Jul 3, 2023 · 1 comment

Comments

@piyushyadavNP
Copy link

piyushyadavNP commented Jul 3, 2023

Describe the bug
java.lang.NoSuchMethodError: No static method decodeHex(Ljava/lang/String;)[B in class Lorg/apache/commons/codec/binary/Hex; or its super classes (declaration of 'org.apache.commons.codec.binary.Hex' appears in /system/framework/org.apache.http.legacy.boot.jar)
at com.emv.qrcode.core.model.cpm.BERTLBinary.toPrimitives(BERTLBinary.java:35)
at com.emv.qrcode.core.model.cpm.BERTLBinary.(BERTLBinary.java:26)

To Reproduce
Steps to reproduce the behavior:

  1. Downgrade API Level to 26

I am getting this error while targeting to android 8 and 8.1

@apkelly
Copy link

apkelly commented Dec 18, 2024

Android ships an old version of commons-codec internally, which is the one found before any libraries shipped with an app. Hence the error above. The fix is to not use commons-codec internally to convert Hex to String (or to use a method available on the really old version of commons-codec that is shipped with Android).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants