5

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

Alexis C.
  • 91,686
  • 21
  • 171
  • 177
Adi Ohana
  • 927
  • 2
  • 13
  • 18
  • 3
    Maybe this http://stackoverflow.com/questions/9126567/method-not-found-using-digestutils-in-android – StoopidDonut Jan 18 '14 at 17:57
  • It could be related.The thing is that I cannot change anything in this library sine this is Kaltura's library (external API) – Adi Ohana Jan 18 '14 at 18:00
  • What if you put commons commons-codec-1.4.jar and commons-httpclient-3.1.jar directly in your lib folder? Or you can try to open the kaltura lib using jar xvf to see if the content is what you expect. – elbuild Jan 18 '14 at 19:16
  • I have commons-codec-1.10.jar in libs folder, and still have this problem. – Hong Feb 11 '15 at 02:53

2 Answers2

1

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

Oferch
  • 71
  • 7
1

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

mvmn
  • 3,717
  • 27
  • 30