javaandroidkotlinsdklibs

Getting java.lang.UnsatisfiedLinkError: No implementation found for error


I am using a third party library for printing purposes in my Kotlin Android app. I am getting this error when running the application and clicking the print button.

I have added the .so files in the jniLibs folder. Can anyone help me with this. I can share the project as well but you will need a physical printer from the company I am using this SDK from.

[![> Fatal Exception: java.lang.UnsatisfiedLinkError: No implementation

found for int com.icod.serial.SerialPort.native_open(java.lang.String, int, int, int) (tried Java_com_icod_serial_SerialPort_native_1open and Java_com_icod_serial_SerialPort_native_1open__Ljava_lang_String_2III) at com.icod.serial.SerialPort.native_open(SerialPort.java) at com.icod.serial.SerialPort.open(SerialPort.java:76) at com.szsicod.print.io.SerialAPI.openDevice(SerialAPI.java:36) at com.szsicod.print.escpos.PrinterAPI.connect(PrinterAPI.java:370) at com.tahreem.testmasungapplication.MainActivity.printIcod(MainActivity.kt:97)]

Image attached

Image


Solution

  • The issue was fixed long time ago. Had to reimplement everything from scratch.

    1. Added the JAR file in the libs folder.
    2. Run the JAR file inside the android studio so that it can install all its components inside the folder.
    3. Add all the other .SO files.
    4. Used a third party library for converting View to Bitmap and used to send the same bitmap for printing. Available on github-> implementation 'id.zelory:cekrek:1.0.0'
    5. Implement the methods for printing the project. Had to use the USB cable so as the printer works.

    And it worked like a charm.