I'm trying to write an app that uses my device's barcode reader.
I have an example Java app that does the job and I've changed it so that it creates an .AAR file that includes the class that I need.
I have created a Xamarin binding library and included that in my application and that binding has successfully generated a
BarCodeReader class that mirrors the Java class that I am trying to use.
The problem is that it throws an exception when I call the first method in the
BarCodeReader class. The logcat entry for the exception is:
07-29 09:08:17.025 9807-9807/com.xamarin.samples.taskyandroid W/System.err﹕ java.lang.UnsatisfiedLinkError: Couldn't load barcodereader44 from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xamarin.samples.taskyandroid-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.xamarin.samples.taskyandroid-1, /vendor/lib, /system/lib]]]: findLibrary returned null
I've examined the .AAR file and it does contain this library along with others that it loads:
libbarcodereader44.so. At the point that the error is thrown it appears to have successfully loaded
libSDL.so and it fails when trying to load
libbarcodereader44.so (the other two aren't loaded because they are for older versions of Android.
If I try to include any of these files into my application project with the
AndroidNativeLibrary build action, I get the following error:
The "BuildApk" task failed unexpectedly. System.ArgumentException: An item with the same key has already been added.
Does anyone know why it fails to use this lib file and why it seems to be ok with IAL and SDL?