Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Hex.encodeHexString

I am using Kaltura API in my android App.

I can use several API calls but each time I am trying to use a method includes in commons-codec-1.4.jar I get error and the App crashes.

This is my LogCat:

01-18 19:38:27.863: E/AndroidRuntime(21488): FATAL EXCEPTION: main
01-18 19:38:27.863: E/AndroidRuntime(21488): java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Hex.encodeHexString
01-18 19:38:27.863: E/AndroidRuntime(21488):    at org.apache.commons.codec.digest.DigestUtils.md5Hex(DigestUtils.java:226)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at com.kaltura.client.KalturaClientBase.signature(KalturaClientBase.java:583)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at com.kaltura.client.KalturaClientBase.extractParamsFromCallQueue(KalturaClientBase.java:491)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at com.kaltura.client.KalturaClientBase.doQueue(KalturaClientBase.java:247)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at com.kaltura.client.services.KalturaMediaService.add(KalturaMediaService.java:65)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at adi.apps.wedding.MyProfile.onClick(MyProfile.java:120)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at android.view.View.performClick(View.java:4240)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at android.view.View$PerformClick.run(View.java:17721)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at android.os.Handler.handleCallback(Handler.java:730)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at android.os.Handler.dispatchMessage(Handler.java:92)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at android.os.Looper.loop(Looper.java:137)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at android.app.ActivityThread.main(ActivityThread.java:5103)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at java.lang.reflect.Method.invokeNative(Native Method)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at java.lang.reflect.Method.invoke(Method.java:525)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-18 19:38:27.863: E/AndroidRuntime(21488):    at dalvik.system.NativeStart.main(Native Method)

I think that there is something wrong in my BuildPath but I cannot point anything specific.

I have the following Jar's:

commons-codec-1.4.jar
commons-httpclient-3.1.jar
(under the kalturaClient lib)

android-support-v4.jar
(under my App lib)

When debugging this, I can see that it fails in this method:

String md5 = DigestUtils.md5Hex(str);

And, I can see that the library does not have a source:

import org.apache.commons.codec.digest.DigestUtils;

Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found

like image 470
Adi Ohana Avatar asked Nov 01 '22 06:11

Adi Ohana


2 Answers

Why can't you change the kaltura client? You have the sources, so just make the necessary change

like image 122
Oferch Avatar answered Nov 04 '22 07:11

Oferch


Put commons-codec-1.4.jar in your App's lib. Obviously, it is required but not present.

like image 35
mvmn Avatar answered Nov 04 '22 08:11

mvmn