Could not load needed library 'libiconv.so' error

Andrew Low
2013-02-06
2013-11-12
  • Andrew Low
    Andrew Low
    2013-02-06

    Hi there,

    I just downloaded ZBarAndroidSDK-0.2 and I am trying to get the CameraTest running however when I run my app on my device, I get this error in the LogCat:

    02-06 17:39:10.294: E/AndroidRuntime(2304): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1969]: 118 could not load needed library 'libiconv.so' for 'libzbarjni.so' (load_library[1111]: Library 'libiconv.so' not found)

    Have I done anything wrong?

    I imported the libs directory as per instructions and can see the zbar.jar along with the armeabi, armeabi-v7a and x86 directories.

    Project compiles and attempts to run on my phone...

    Phone used: Nexus 1 with Gingerbread 2.3.3
    IDE: Eclipse ADT Build: v21.0.1-543035
    Android SDK Tool: 21.0.1

    Thank you for your help.

    Andrew

     
  • It's a step missing in the instructions. I was banging my head all day today because of this.

    You need to load the library yourself. You can use the following code in the first Activity you want to use scanner.

    static {
        System.loadLibrary("iconv");
    }
    

    If you followed the other instructions, you should be set.

     
    • Andrew Low
      Andrew Low
      2013-02-13

      Duh, I see now. Thank you! :)

       
  • Levent Aymelek
    Levent Aymelek
    2013-11-12

    Hi,

    i am having a similar problem. I am trying to implement zbar with android studio. My SDK (V 0.2) already have the code under CameraTestActivity

    static {
    System.loadLibrary("iconv");
    }

    but i get the error on "System.loadLibrary("iconv")"

    it says:
    Caused by: java.lang.UnsatisfiedLinkError: Couldn't load iconv: findLibrary returned null

    I will appritiate some help!