Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: gradle exclude commons-codec

In my android project I need commons-codec 1.8 and I would like to exclude the built-in commons-codec version. I also have some maven dependencies and I want them use 1.8 instead of built-in.

Here is the error message, it looks like the built in jar is in /system/framework/ext.jar

java.lang.NoSuchMethodError: No static method encodeHex([BZ)[C in class
 Lorg/apache/commons/codec/binary/Hex; or its super classes (declaration of
 'org.apache.commons.codec.binary.Hex' appears in /system/framework/ext.jar)
like image 356
TheModularMind Avatar asked Feb 18 '26 17:02

TheModularMind


1 Answers

add to your build.gradle file

dependencies {
    compile 'commons-codec:commons-codec:1.8'
}
like image 118
Toda Raba Avatar answered Feb 21 '26 13:02

Toda Raba



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!