我正在尝试在带有android studio的android项目中使用java库,但出现下一个错误日志:
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)
这是我要使用的外部库:
implementation files('libs/CoDiLibrary.jar')
在我的MainActivity的onCreate方法中,我这样做:
String keySource = CoDi.keySource("123456","3434j34h43j","5551234567");
这些是我项目中的依赖项:
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')
}
要使其在任何api级设备上都能正常工作,我需要更改什么?