locked
unsatisfied link error RRS feed

  • Question

  • User15495 posted

    i've poured over the troubleshooting documentation and haven't found anything that seems to fit the issue I'm having. hoping someone can see something i'm overlooking, and hope it's a simple over-site on my part.

    i've got an alien alr-h450 rfid reader running android 4.4.2 and they have an sdk which i've successfully (I think, but maybe not as i'm having issues) created a binding library around and created a xamarin android app with a simple out of the box default main.axml w/ "hello world, click me" button on it where i execute the default alien sdk sample code.

    the problem happens in my button click event where i call the alien sdk sample code i get a java.lang.unsatisfiedlinkerror couldnt load aliencus from loader dalvik.system.pathclassloader ... it seems to my uneducated brain that the underlying .aar file perhaps isn't where it should be, or something inside it isn't where it should be when things are loaded into memory or something... anyway.

    i've uploaded my sample project here: https://www.dropbox.com/s/jort3e9xzr1gv22/MoblePortal.zip?dl=0 though i'm pretty sure you'd have to have the scanner to run it but just in case anyone smarter than i could look at what's going on and see something glaring and know i'm putting it out there.

    any help, time or thoughts are appreciated.

    Friday, March 31, 2017 10:16 PM

Answers

  • User12817 posted

    @almightybob

    the problem happens in my button click event where i call the alien sdk sample code i get a java.lang.unsatisfiedlinkerror couldnt load aliencus from loader dalvik.system.pathclassloader ... it seems to my uneducated brain that the underlying .aar file perhaps isn't where it should be, or something inside it isn't where it should be when things are loaded into memory or something... anyway.

    I can't tell exactly what this error is because you didn't grab the full stack trace, but there's a couple of things to note:

    1. Devices with "scanners/readers/etc" typically have the hardware AND software needed to run these readers. That typically includes a hardware piece such as the instrument to scan, and then the software piece such as a native library that gets invoked.
    2. If you try to run this library on a device that doesn't have support for one of the two items above(hardware/software), you will most likely run into a linking error where it cannot find the native library it needs to execute the code. Thus a sample project won't really help too much unless I also had the alien device that you do.

    What I recommend:

    • Get the full stack trace and upload it to a reply in this forum post. Use the three ` ticks for a code block to format it nicely.
    • Get an adb logcat log of you running your application to the point of the failure. This way we can see if it's sniffing for a certain library or path.
    • A quick break as these problems can sometimes invoke headaches!
    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, April 3, 2017 5:22 PM
  • User15495 posted

    thanks! I was able to get a hold of the mfg. turns out the lib had to be bindings library had to be bound against jdk 1.7 and android 4.4.2 while the application could be latest and greatest and jdk 1.8 and they were able to provide me with a xamarin project that worked on the hardware that didn't have unsatisfied link errors (even they had issues).

    thanks for the responess. I didn't provide full stack traces because in this instance they basically just said it couldn't load the lib i mentioned from my app but was far more verbose and sort of pointless.

    thanks again though ;)

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, April 5, 2017 9:06 PM
  • User3537 posted

    @"DiegoFelipeHoyosMoreno.8659"

    If you want to create the binding yourself here are the steps:

    For the binding: - it must target android 4.4 - it must target java JDK 1.7

    To select the JDK 7.0, open menu Xamarin Studio / Preferences… then in the setting Projects / SDK Locations / Android change the JDK location, mine is /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home

    For the app: The JDK location setting is not attached to a specific project, its an environment setting so don’t forget to set it back to the current JDK version. Set the minimum android version to android 4.4

    And the settings that made all the difference for me, is to use only armeabi architecture when building the app. If I add armeabi-v7a, it crashes on the RFID.Open() call. In the project options, in android build options, select only armeabi in the “Advanced” tag

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, July 13, 2017 8:28 PM

All replies

  • User12817 posted

    @almightybob

    the problem happens in my button click event where i call the alien sdk sample code i get a java.lang.unsatisfiedlinkerror couldnt load aliencus from loader dalvik.system.pathclassloader ... it seems to my uneducated brain that the underlying .aar file perhaps isn't where it should be, or something inside it isn't where it should be when things are loaded into memory or something... anyway.

    I can't tell exactly what this error is because you didn't grab the full stack trace, but there's a couple of things to note:

    1. Devices with "scanners/readers/etc" typically have the hardware AND software needed to run these readers. That typically includes a hardware piece such as the instrument to scan, and then the software piece such as a native library that gets invoked.
    2. If you try to run this library on a device that doesn't have support for one of the two items above(hardware/software), you will most likely run into a linking error where it cannot find the native library it needs to execute the code. Thus a sample project won't really help too much unless I also had the alien device that you do.

    What I recommend:

    • Get the full stack trace and upload it to a reply in this forum post. Use the three ` ticks for a code block to format it nicely.
    • Get an adb logcat log of you running your application to the point of the failure. This way we can see if it's sniffing for a certain library or path.
    • A quick break as these problems can sometimes invoke headaches!
    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, April 3, 2017 5:22 PM
  • User15495 posted

    thanks! I was able to get a hold of the mfg. turns out the lib had to be bindings library had to be bound against jdk 1.7 and android 4.4.2 while the application could be latest and greatest and jdk 1.8 and they were able to provide me with a xamarin project that worked on the hardware that didn't have unsatisfied link errors (even they had issues).

    thanks for the responess. I didn't provide full stack traces because in this instance they basically just said it couldn't load the lib i mentioned from my app but was far more verbose and sort of pointless.

    thanks again though ;)

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, April 5, 2017 9:06 PM
  • User327162 posted

    Hey! I'm doing the same coding with the alien reader and having some issues. First, I couldn't even get the aar file to bind, so instead I was able to export the jar file and was able to bind that without any errors, but then I'm getting the same error you had above. Can you post the sample project that Alien sent you to dropbox?

    Tuesday, May 30, 2017 5:24 AM
  • User327162 posted

    I'm able to bind, but the callback for the continuous inventory is having some issues. Were you able to solve it?

    Tuesday, May 30, 2017 5:06 PM
  • User15495 posted

    From what I recall the bindings and project libraries were different (as I mentioned in my last post) and that was what was causing the link error for me. After I got the bindings library to compile correctly everything else worked. If you contact Allen support they can get you a working sample (they're really responsive) for xamarin that includes what you're trying to do with the inventory function.

    From what I recall there was some weird setup required for inventory that they provided and the event handler they sent for processing was very Java like in the event handler.

    If I get a chance later today I'll try to post what they sent.

    Wednesday, May 31, 2017 11:20 AM
  • User15495 posted

    @scotm1971

    here's the sample that their support provided if that helps.

    Wednesday, May 31, 2017 6:08 PM
  • User328966 posted

    @almightybob said: @scotm1971

    here's the sample that their support provided if that helps.

    Man I owe you one! seriously I tried really hard to make it work, you nail it with the DLL, can you tell exactly how you change de jdk version so it works??

    Tuesday, June 27, 2017 3:45 AM
  • User15495 posted

    I didn't compile it. I tried to do what they said to do i.e. compile the lib/dll Bindings library against jdk 1.7 and android 4.4.2. then set the app to use jdk 1.8 and latest and greatest version of Android.

    I didn't have a lot of time to work with it after they sent me the sample that I attached here (Had to move to another project), I was just mocking up a poc app that's similar to stuff we do on the other windows mobile 6.5 devices.

    For what it's worth I tried and failed to successfully create the bindings library even after they said how to do it. I didn't see where you could specify the jdk version (and honestly don't know where 1.7 is located on my Mac. I'm guessing there's probably some command line option on the app--the name of which escapes me at the moment--that generates the binding) so I just used the lib dll they sent.

    I'd rather have a bindings lib we build but need an app that actually works, so we're sticking with the one alien provided for xamarin.

    Tuesday, June 27, 2017 4:22 AM
  • User3537 posted

    @"DiegoFelipeHoyosMoreno.8659"

    If you want to create the binding yourself here are the steps:

    For the binding: - it must target android 4.4 - it must target java JDK 1.7

    To select the JDK 7.0, open menu Xamarin Studio / Preferences… then in the setting Projects / SDK Locations / Android change the JDK location, mine is /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home

    For the app: The JDK location setting is not attached to a specific project, its an environment setting so don’t forget to set it back to the current JDK version. Set the minimum android version to android 4.4

    And the settings that made all the difference for me, is to use only armeabi architecture when building the app. If I add armeabi-v7a, it crashes on the RFID.Open() call. In the project options, in android build options, select only armeabi in the “Advanced” tag

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, July 13, 2017 8:28 PM
  • User15495 posted

    @"John.0817" i think that's the bit of information i was originally missing (and makes sense now to read it). I had both binding and app in the same solution and didn't see where to target the jdk on a project by project basis. thanks for that!

    Thursday, July 13, 2017 10:54 PM
  • User362171 posted

    you are the best. I solved my problem since trying 2 weeks.

    Friday, December 15, 2017 3:35 PM
  • User361679 posted

    @almightybob said: @scotm1971

    here's the sample that their support provided if that helps.

    Hey so I've been using this project to build my own app, however this uses an older alienapi that does not have the option to acquire TID with inventory. I'm trying to build my own binding library but it ends up missing callbacks etc., Visual Studio 2017 also will not let me use jdk 1.7 as the above post by John.0817 says.

    Has anyone built this already or does anyone know how to do this?

    Sunday, December 17, 2017 12:22 AM
  • User15495 posted

    @trevorm7

    Another team at work took over this project. I know due to some bugs that may have been in alien's API they may also be using a new version as well, I'm out for a few weeks but if I can remember I'll ask them about it.

    My recommendation would be to hit up alien support directly for a Xamarin version of their latest library. I've worked with them for years, and their support is always great.

    Sunday, December 17, 2017 12:35 AM
  • User361679 posted

    @almightybob

    Thanks, I did already ask Alien support if they had an alienapi.dll with the TID option and the answer was that they do not provide support on Xamarin beyond the fact that they know users do use it, so that doesn't appear to be an option.

    Sunday, December 17, 2017 3:12 AM
  • User15495 posted

    @trevorm7 I'm not sure if this dll will work. I couldn't get it to build using jdk 1.7 (threw an error about the build target needing 1.8 for build-tools and couldn't get it to actually generate anything unchecking that and using 1.7) so this may not work, but here's a sample dll and the project i used to build it. Since i'm out on vacation for a bit I don't have an alr-450 to test it on so i can't promise it works.

    note, i did this on a mac and while i know you can open / compile the dll using vs for windows there may be some other IDE level settings that need to be sorted to get it to compile right... good luck (i find the original xamarin studio / monodevelop / vs for mac better at building the android / ios apps).

    this one is built off their latest sdk and the generated code shows a tag with the TID property:

    AlienAPI_v1.0.7.170201.zip is a release build of the dll AlienAPI.zip is the bindings project / solution

    Sunday, December 24, 2017 5:47 AM
  • User361679 posted

    @almightybob

    Thanks, I just tried this on my project and it actually works (at least it doesn't crash and will do basic inventory. I haven't tested any further than that yet.)

    Since you've used this reader before, I have a question, have you had issues with the session settings not having any effect? For me no matter what I set it to it always acts as if it's S0 or targeting both A an B. It will just scan the same tags repeatedly without any delay which makes it hard to get every tag in a crowded environment. This isn't just with the api, but with the official demo app as well.

    So far support hasn't come up with a solution so it would be good to know if this is just a problem with me or my hardware. Maybe a change was made at some point along the line or it just never worked properly in the first place.

    Trevor

    Sunday, December 24, 2017 8:54 PM
  • User15495 posted

    I haven't but the team that took over has. They just set it to session zero and A only instead of dual target. We've had to do something similar with the Motorola/symbol reader in the past.

    Sunday, December 24, 2017 9:15 PM
  • User361679 posted

    @almightybob

    Just got the solution from support. It turned out that the SearchMode property was never in the API so it was always on dual target mode with no way to change it. They made an updated version and sent it to me.

    Here is a link to the H450 API update (1.0.9) that adds getSearchMode() and setSearchMode (SearchMode.DUAL | SearchMode.SINGLE) methods.

    drive.google.com/open?id=1BxXw5YZyanevAheNqK1yd6PPs50oLvc6

    In order to see the effect of a single mode, call setSearchMode (SearchMode.SINGLE) first and then call the inventory() method with the ‘mask’ parameter set to null: inventory(listener, null).

    This will clear the mask and perform continuous inventories without re-selecting tags and you should only see new tag reads after the persist time expires for the current session (e.g. 1-2 sec for S1 and about 60 sec for S2/S3).

    Attached is the Xamarin binding I made with your project also, just in case anyone needs it.

    Either your team already got this update or a similar fix from support or they actually aren't able to run in single target mode.

    Trevor

    Thursday, January 25, 2018 12:03 AM
  • User15495 posted

    @trevorm7 actually i talked to the team lead for that project just after new years, and he said they hadn't updated the sdk from the first one i posted (how or if they actually have it working correctly is beyond me).

    I'll point them to this thread so they can get the 1.0.9 bindings.

    Thanks!

    Thursday, January 25, 2018 12:55 AM
  • User362171 posted

    Hi,

    Is it possible to pass scanned value terminal application like wavelink vt220? or keyboard?

    Thansk

    Friday, January 26, 2018 1:20 PM
  • User377678 posted

    Thanks for all your help. When I build my own binding or use one of the one's above, I get the following error when I reference the dll in my project when trying to enter the RFID.Open() method.

    The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'.

    Any suggestions?

    Thanks.

    Monday, September 17, 2018 3:55 PM