ScanditSDK - Couldn't load scanditsdk-android-3.5.1: findLibrary returned null

I've downloaded the ScanditSDk sample from the componente store and registered in the Scandit website to get an API key.
I've changed the key in the sample, but when I try to run the app, it throws an exception when it tries to create a new instance of 'ScanditSDKAutoAdjustingBarcodePicker'.
What am I missing?

Full details of the exception:

An unhandled exception occured.
10-02 12:26:45.133 I/MonoDroid(26696): UNHANDLED EXCEPTION: Java.Lang.LinkageError: Exception of type 'Java.Lang.LinkageError' was thrown.
10-02 12:26:45.133 I/MonoDroid(26696):   at Android.Runtime.JNIEnv.NewObject (IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue[] parms) [0x00000] in <filename unknown>:0 
10-02 12:26:45.133 I/MonoDroid(26696):   at Scandit.ScanditSDKAutoAdjustingBarcodePicker..ctor (Android.App.Activity p0, System.String p1, Int32 p2) [0x00000] in <filename unknown>:0 
10-02 12:26:45.133 I/MonoDroid(26696):   at XamarinScanditSDKDemoAndroid.ScanActivity.OnCreate (Android.OS.Bundle bundle) [0x00000] in <filename unknown>:0 
10-02 12:26:45.133 I/MonoDroid(26696):   --- End of managed exception stack trace ---
10-02 12:26:45.133 I/MonoDroid(26696): java.lang.UnsatisfiedLinkError: Couldn't load scanditsdk-android-3.5.1: findLibrary returned null
10-02 12:26:45.133 I/MonoDroid(26696):  at java.lang.Runtime.loadLibrary(Runtime.java:365)
10-02 12:26:45.133 I/MonoDroid(26696):  at java.lang.System.loadLibrary(System.java:535)
10-02 12:26:45.133 I/MonoDroid(26696):  at com.mirasense.scanditsdk.ScanditSDKBarcodePicker.initializeRecognitionEngine(ScanditSDKBarcodePicker.java:1284)
10-02 12:26:45.133 I/MonoDroid(26696):  at com.mirasense.scanditsdk.ScanditSDKBarcodePicker.<init>(ScanditSDKBarcodePicker.java:330)
10-02 12:26:45.133 I/MonoDroid(26696):  at com.mirasense.scanditsdk.ScanditSDKAutoAdjustingBarcodePicker.<init>(ScanditSDKAutoAdjustingBarcodePicker.java:59)
10-02 12:26:45.133 I/MonoDroid(26696):  at xamarinscanditsdkdemoandroid.ScanActivity.n_onCreate(Native Method)
10-02 12:26:45.133 I/MonoDroid(26696):  at xamarinscanditsdkdemoandroid.ScanActivity.onCreate(ScanActivity.java:32)
10-02 12:26:45.133 I/MonoDroid(26696):  at android.app.Activity.performCreate(Activity.java:5008)
10-02 12:26:45.133 I/MonoDroid(26696):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
10-02 12:26:45.133 I/MonoDroid(26696):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2029)
10-02 12:26:45.133 I/MonoDroid(26696):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2090)
10-02 12:26:45.133 I/MonoDroid(26696):  at android.app.ActivityThread.access$600(ActivityThread.java:136)
10-02 12:26:45.133 I/MonoDroid(26696):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
10-02 12:26:45.133 I/MonoDroid(26696):  at android.os.Handler.dispatchMessage(Handler.java:99)
10-02 12:26:45.133 I/MonoDroid(26696):  at android.os.Looper.loop(Looper.java:137)
10-02 12:26:45.133 I/MonoDroid(26696):  at android.app.ActivityThread.main(ActivityThread.java:4800)
10-02 12:26:45.133 I/MonoDroid(26696):  at java.lang.reflect.Method.invokeNative(Native Method)
10-02 12:26:45.133 I/MonoDroid(26696):  at java.lang.reflect.Method.invoke(Method.java:511)
10-02 12:26:45.133 I/MonoDroid(26696):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:798)
10-02 12:26:45.133 I/MonoDroid(26696):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:565)
10-02 12:26:45.133 I/MonoDroid(26696):  at dalvik.system.NativeStart.main(Native Method)
Unhandled Exception:

Java.Lang.LinkageError: Loading...
10-02 12:26:46.084 E/mono    (26696): 
10-02 12:26:46.084 E/mono    (26696): Unhandled Exception:
10-02 12:26:46.084 E/mono    (26696): Java.Lang.LinkageError: Exception of type 'Java.Lang.LinkageError' was thrown.
10-02 12:26:46.084 E/mono    (26696):   at Android.Runtime.JNIEnv.NewObject (IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue[] parms) [0x00000] in <filename unknown>:0 
10-02 12:26:46.084 E/mono    (26696):   at Scandit.ScanditSDKAutoAdjustingBarcodePicker..ctor (Android.App.Activity p0, System.String p1, Int32 p2) [0x00000] in <filename unknown>:0 
10-02 12:26:46.084 E/mono    (26696):   at XamarinScanditSDKDemoAndroid.ScanActivity.OnCreate (Android.OS.Bundle bundle) [0x00000] in <filename unknown>:0 
10-02 12:26:46.084 E/mono    (26696):   --- End of managed exception stack trace ---
10-02 12:26:46.084 E/mono    (26696): java.lang.UnsatisfiedLinkError: Couldn't load scanditsdk-android-3.5.1: findLibrary returned null
10-02 12:26:46.084 E/mono    (26696):   at java.lang.Runtime.loadLibrary(Runtime.java:365)
10-02 12:26:46.084 E/mono    (26696):   at java.lang.System.loadLibrary(System.java:535)
10-02 12:26:46.084 E/mono    (26696):   at com.mirasense.scanditsdk.ScanditSDKBarcodePicker.initializeRecognitionEngine(ScanditSDKBarcodePicker.java:1284)
10-02 12:26:46.084 E/mono    (26696):   at com.mirasense.scanditsdk.ScanditSDKBarcodePicker.<init>(ScanditSDKBarcodePicker.java:330)
10-02 12:26:46.084 E/mono    (26696):   at com.mirasense.scanditsdk.ScanditSDKAutoAdjustingBarcodePicker
10-02 12:26:46.084 E/mono-rt (26696): [ERROR] FATAL UNHANDLED EXCEPTION: Java.Lang.LinkageError: Exception of type 'Java.Lang.LinkageError' was thrown.
10-02 12:26:46.084 E/mono-rt (26696):   at Android.Runtime.JNIEnv.NewObject (IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue[] parms) [0x00000] in <filename unknown>:0 
10-02 12:26:46.084 E/mono-rt (26696):   at Scandit.ScanditSDKAutoAdjustingBarcodePicker..ctor (Android.App.Activity p0, System.String p1, Int32 p2) [0x00000] in <filename unknown>:0 
10-02 12:26:46.084 E/mono-rt (26696):   at XamarinScanditSDKDemoAndroid.ScanActivity.OnCreate (Android.OS.Bundle bundle) [0x00000] in <filename unknown>:0 
10-02 12:26:46.084 E/mono-rt (26696):   --- End of managed exception stack trace ---
10-02 12:26:46.084 E/mono-rt (26696): java.lang.UnsatisfiedLinkError: Couldn't load scanditsdk-android-3.5.1: findLibrary returned null
10-02 12:26:46.084 E/mono-rt (26696):   at java.lang.Runtime.loadLibrary(Runtime.java:365)
10-02 12:26:46.084 E/mono-rt (26696):   at java.lang.System.loadLibrary(System.java:535)
10-02 12:26:46.084 E/mono-rt (26696):   at com.mirasense.scanditsdk.ScanditSDKBarcodePicker.initializeRecognitionEngine(ScanditSDKBarcodePicker.java:1284)
10-02 12:26:46.084 E/mono-rt (26696):   at com.mirasense.scanditsdk.ScanditSDKBarcodePicker.<init>(ScanditSDKBarcodePicker.java:330)
10-02 12:26:46.084 E/mono-rt (26696):   at com.mirasense.scanditsdk.ScanditSDKAutoAdjusting
The program 'Mono' has exited with code 0 (0x0).

Posts

  • Have you added Internet and Camera permissions? The demo requires the Internet and scanning requires Camera.

  • Hi,

    this is Christian from Scandit Support. The Scandit Component for Android loads a shared library and in your setup this step seems to be failing. Can you let us know which Android device you are using for your testing, which Android OS version is running on the device and which Xamarin.Android version you are using?

    We will try to replicate the issue at our end and get back to you.

  • JosePereiraJosePereira PTMember, Beta

    @JasonFamularo Yes, those permissions are in the android's manifest.

    @ChristianFloerkemeier I'm runnig the sample app on a Sony Experia L. The Android OS version is 4.1.2 and the Xamarin.Droid version is 4.8.1

    Thank you

  • JosePereiraJosePereira PTMember, Beta

    Just a follow-up, I've also tried the same app in a Samsung Galaxy Fame, with Android OS 4.1.2 and Xamarin.Droid 4.8.1, and the result was the same as before.

    Both the Sony and the Samsung have internet connectivity.

  • Sadly we have not been able to reproduce this problem with any of our devices and don't have any concrete ideas why the library is not where it should be. If you go to the project options under "Android Build", do you have any non standard settings there? Which boxes are checked in the Advanced tab?

  • DaElDaEl USMember
    edited October 2013

    Hi,

    I know I've gotten similar (but not the same) errors when I first ran the sample. The long path name to the required library was too long for my OS I guess, so the library was never written to desk when I installed the project. I had to unpack it to another location (right off the root of my C drive). You might be having a similar problem.

  • We received a Sony Experia and tried running the project on the device, but we could not reproduce the library loading issue you reported above.

    Could you unzip the apk file that is generated by Xamarin and see whether the shared library is actually present in the apk file? (you might have to rename the apk file to a .zip file to unzip it). If it is not present, could you let us know whether David's recommendation to move the project to a different location with a short file path helped?

    The content of the file should look something like this:

    Archive: HelloWorld.zip
    extracting: res/drawable/icon.png
    inflating: res/layout/main.xml
    inflating: AndroidManifest.xml
    extracting: resources.arsc
    inflating: classes.dex
    inflating: lib/armeabi-v7a/libscanditsdk-android-3.5.1.so
    inflating: lib/armeabi/libscanditsdk-android-3.5.1.so
    inflating: lib/armeabi-v7a/libmonodroid.so
    inflating: lib/armeabi-v7a/libmono-profiler-log.so
    inflating: lib/armeabi/libmonodroid.so
    inflating: lib/armeabi/libmono-profiler-log.so
    inflating: lib/x86/libmonodroid.so
    inflating: lib/x86/libmono-profiler-log.so

  • rickharickha INMember

    Hi ChristianFloerkemeier,

    I am also getting the same library issue.

    I have downloaded your barcode sample and tried to customized it in my demo app but suddenly it starts giving

    UnsatisfiedLinkedError

    Coudn't load scandit sdk 3.5.3 returned null

    Please give me some suggestion if your able to reprodue this bug

    my os version is 4.1.2

    model is samsung GT-P3100

    Thanks,

  • rickharickha INMember

    Hi ChristianFloerkemeier,

    Please find the log info it can help you better to make the issues resolved.

    02-11 14:25:25.453: E/AndroidRuntime(9843): FATAL EXCEPTION: main
    02-11 14:25:25.453: E/AndroidRuntime(9843): java.lang.UnsatisfiedLinkError: Couldn't load scanditsdk-android-3.5.3: findLibrary returned null
    02-11 14:25:25.453: E/AndroidRuntime(9843): at java.lang.Runtime.loadLibrary(Runtime.java:365)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at java.lang.System.loadLibrary(System.java:535)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at com.mirasense.scanditsdk.ScanditSDKBarcodePicker.initializeRecognitionEngine(ScanditSDKBarcodePicker.java:1364)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at com.mirasense.scanditsdk.ScanditSDKBarcodePicker.(ScanditSDKBarcodePicker.java:333)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at com.mirasense.scanditsdk.ScanditSDKAutoAdjustingBarcodePicker.(ScanditSDKAutoAdjustingBarcodePicker.java:61)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at com.mirasense.demos.ScanditSDKSampleBarcodeActivity.initializeAndStartBarcodeScanning(ScanditSDKSampleBarcodeActivity.java:146)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at com.mirasense.demos.ScanditSDKSampleBarcodeActivity.onCreate(ScanditSDKSampleBarcodeActivity.java:113)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at android.app.Activity.performCreate(Activity.java:5163)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at android.app.ActivityThread.access$600(ActivityThread.java:140)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at android.os.Handler.dispatchMessage(Handler.java:99)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at android.os.Looper.loop(Looper.java:137)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at android.app.ActivityThread.main(ActivityThread.java:4895)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at java.lang.reflect.Method.invokeNative(Native Method)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at java.lang.reflect.Method.invoke(Method.java:511)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
    02-11 14:25:25.453: E/AndroidRuntime(9843): at dalvik.system.NativeStart.main(Native Method)

    Thanks,

  • HardyErlingerHardyErlinger DEMember
    edited April 2014

    Hi,

    I am experiencing the same error although it doesn't happen on a physical device but the Genymotion emulator version 2.2.0. The virtual device is running API 18 and I am on Xamarin.Android 4.12.2 running Xamarin Studio 4.2.3 on Windows 7 (64 bit).

    The stack trace is a follows:

    Java.Lang.UnsatisfiedLinkError: Couldn't load scanditsdk-android-3.5.3 from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/letsgeo.android-1.apk"],nativeLibraryDirectories=[/data/app-lib/letsgeo.android-1, /system/lib]]]: findLibrary returned null at Android.Runtime.JNIEnv.NewObject (intptr,intptr,Android.Runtime.JValue[]) [0x00030] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/a1e3982a/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:575 at at Scandit.ScanditSDKAutoAdjustingBarcodePicker..ctor (Android.App.Activity,string,int) <IL 0x00111, 0x00517> at LetsGeo.Android.Activities.ScanActivity.OnCreate (Android.OS.Bundle) [0x00028] in e:\projects\GEO\Frontend\dev\LetsGeo.Android\Activities\ScanActivity.cs:31 at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/a1e3982a/source/monodroid/src/Mono.Android/platforms/android-18/src/generated/Android.App.Activity.cs:2178 at at (wrapper dynamic-method) object.cb212c57-1870-4b54-a98d-ef179fe4b33b (intptr,intptr,intptr) <IL 0x00017, 0x0001f> at --- End of managed exception stack trace --- at java.lang.UnsatisfiedLinkError: Couldn't load scanditsdk-android-3.5.3 from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/letsgeo.android-1.apk"],nativeLibraryDirectories=[/data/app-lib/letsgeo.android-1, /system/lib]]]: findLibrary returned null at at java.lang.Runtime.loadLibrary(Runtime.java:355) at at java.lang.System.loadLibrary(System.java:525) at at com.mirasense.scanditsdk.ScanditSDKBarcodePicker.initializeRecognitionEngine(ScanditSDKBarcodePicker.java:1364) at at com.mirasense.scanditsdk.ScanditSDKBarcodePicker.<init>(ScanditSDKBarcodePicker.java:333) at at com.mirasense.scanditsdk.ScanditSDKAutoAdjustingBarcodePicker.<init>(ScanditSDKAutoAdjustingBarcodePicker.java:61) at at letsgeo.android.activities.ScanActivity.n_onCreate(Native Method) at at letsgeo.android.activities.ScanActivity.onCreate(ScanActivity.java:35) at at android.app.Activity.performCreate(Activity.java:5133) at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175) at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) at at android.app.ActivityThread.access$600(ActivityThread.java:141) at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at at android.os.Handler.dispatchMessage(Handler.java:99) at at android.os.Looper.loop(Looper.java:137) at at android.app.ActivityThread.main(ActivityThread.java:5103) at at java.lang.reflect.Method.invokeNative(Native Method) at at java.lang.reflect.Method.invoke(Method.java:525) at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at at dalvik.system.NativeStart.main(Native Method)

    I checked the APK created by Xamarin Studio and it contains all the files listed by Christian above. In order to be able to compile the project at all I had to move it to the root of another drive because the paths were too long for the OS to handle. Compilation was possible afterwards and I can successfully run the app on a physical device (Nexus 4) but it fails in the emulator.

    The app has permissions to access both the camera and the internet.

    Any hints on what could be the reason for this? Anything else I should check to enable you to reproduce the problem?

    [Edit: fix two typos]

  • @hardye The current Scandit SDK doesn't support x86 devices (which your emulator is). The newest beta does, which does not yet have a Xamarin binding.

  • HardyErlingerHardyErlinger DEMember

    Thanks for the background information, Jason. Good to know there will be support for x86 devices. Let's hope the binding will be available soon.

Sign In or Register to comment.