unsatisfied link error

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.

Best Answers

  • almightybobalmightybob US ✭✭
    Accepted Answer

    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 ;)

Answers

  • almightybobalmightybob USMember ✭✭
    Accepted Answer

    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 ;)

  • scotm1971scotm1971 USMember
    edited May 2017

    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?

  • scotm1971scotm1971 USMember

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

  • almightybobalmightybob USMember ✭✭
    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.
  • almightybobalmightybob USMember ✭✭
    edited May 2017

    @scotm1971

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

  • @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??

  • almightybobalmightybob USMember ✭✭
    edited June 2017
    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.
  • almightybobalmightybob USMember ✭✭
    edited July 2017

    @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!

  • ozgurkilic.6995ozgurkilic.6995 USMember ✭✭

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

  • trevorm7trevorm7 USMember
    edited December 2017

    @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?

  • almightybobalmightybob USMember ✭✭
    edited December 2017
    @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.
  • trevorm7trevorm7 USMember

    @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.

  • almightybobalmightybob USMember ✭✭
    edited December 2017

    @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

  • trevorm7trevorm7 USMember
    edited December 2017

    @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

  • almightybobalmightybob USMember ✭✭
    edited December 2017
    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.
  • trevorm7trevorm7 USMember
    edited January 2018

    @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

  • almightybobalmightybob USMember ✭✭

    @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!

  • ozgurkilic.6995ozgurkilic.6995 USMember ✭✭

    Hi,

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

    Thansk

  • 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.

Sign In or Register to comment.