Reputation: 63
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
Upvotes: 1
Views: 3297
Reputation: 1112
I faced this error due to small case instead of capital case of Java in c++ file. Make sure first letter java should be capital.
// I used small case of java as you can see below. This is erroneous.
extern "C" JNIEXPORT jstring JNICALL
java_com_vst_local_myapplication_TamperUtils_appSignature(JNIEnv *env, jobject /* this */) {
return env->NewStringUTF("test string");
}
// This is correct one as I used capital case of first letter.
extern "C" JNIEXPORT jstring JNICALL
Java_com_vst_local_myapplication_TamperUtils_appSignature(JNIEnv *env, jobject /* this */) {
return env->NewStringUTF("test string");
}
Upvotes: 0
Reputation: 63
The issue was fixed long time ago. Had to reimplement everything from scratch.
implementation 'id.zelory:cekrek:1.0.0'
And it worked like a charm.
Upvotes: 1