Android: gradle exclude commons-codec

9.8k views Asked by At

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)
1

There are 1 answers

0
Toda Raba On

add to your build.gradle file

dependencies {
    compile 'commons-codec:commons-codec:1.8'
}