Android Question Problem with libserial.so [java.lang.UnsatisfiedLinkError: open]

mrjaw

Active Member
Licensed User
Longtime User
Hi!
I have a few days trying to do a b4A library to print in POS devices.
I am trying to do a wrapper for java SDK that they send me using a external library .so but now I compile fine, but when I try to use this lib in b4A I get this

B4X:
java.lang.UnsatisfiedLinkError: open
 at com.jq.serial.SerialPort2.open(Native Method)
 at com.jq.serial.SerialPort2.SetPort(SerialPort2.java:64)
 at b4a.example.main._button1_click(main.java:416)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:511)
 at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
 at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:337)
 at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:511)
 at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
 at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
 at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
 at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
 at android.view.View.performClick(View.java:3517)
 at android.view.View$PerformClick.run(View.java:14155)
 at android.os.Handler.handleCallback(Handler.java:605)
 at android.os.Handler.dispatchMessage(Handler.java:92)
 at android.os.Looper.loop(Looper.java:154)
 at android.app.ActivityThread.main(ActivityThread.java:4624)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:511)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
 at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Pause, UserClosed = true **
** Activity (main) Resume **
** Service (starter) Destroy **

My project in eclipse has this structure
upload_2017-5-25_13-13-44.png


I have checked almost all post about this but I don't see any error like this. Really the code is so simple open a serial port and try to print something in this .
If somebody has any clues or other solution to print using device POS, printer included, I hear any suggestion


Any clues or any help will be appreciated.
 

mrjaw

Active Member
Licensed User
Longtime User
if somebody has the same problem you need to create the package name android_serialport_api; must be like that or else you get the error that I post here.
But now, the error is worst, it is not printing.
It opens the port and send bytes to the port but nothing happens. I am using the log android but I don't know where is put this file. This device is POS system Chinese with integrated printer and barcode reader. If somebody has any library to works with this device let me know I can pay for this

Thsk
 
Upvote 0
Top