I am trying to use a java library inside my android project with android studio but I get the next error log:
UncaughtException: java.lang.NoSuchMethodError: No static method encodeHexString([B)Ljava/lang/String; 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)
This is the external library I want to use:
implementation files('libs/CoDiLibrary.jar')
and inside the onCreate method of my MainActivity I do this:
String keySource = CoDi.keySource("123456","3434j34h43j","5551234567");
these are the dependencies in my project:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation files('libs/CoDiLibrary.jar')
}
What do I have to change to make it work on any api level device?