Hi
I'm having an java.lang.UnsatisfiedLinkError: openport when calling the following method:
The object fingerprint class contains:
Is there a way i'm not loading my library correctly?
Regards,
Tomas
I'm having an java.lang.UnsatisfiedLinkError: openport when calling the following method:
B4X:
public int OpenSerialPort(String port,int baudrate) {
return getObject().OpenSerialPort(port, baudrate);
}
B4X:
/**
* Initializes the Fingerprint.
* Make sure to have the .so file in your assets folder!
* The .so file will be copied to the internal folder if it's not there.
* @throws IOException
*/
public void Initialize(final BA ba) throws IOException {
this.ba = ba;
//Copies the file to the internal folder.
if (!File.Exists(File.getDirInternal(), "libserial_port.so")) {
File.Copy(File.getDirAssets(), "libserial_port.so", File.getDirInternal(), "libserial_port.so");
Log.i(TAG, "Library copied to Internal Folder.");
}
//Load the library
try {
System.load(File.Combine(File.getDirInternal(), "libserial_port.so"));
Log.i(TAG, "Library loaded!");
} catch (Exception e) {
Log.i(TAG, "Cannot load library: " + e.getMessage());
}
//Initialize the library
setObject(new fingerprint_native());
}
The object fingerprint class contains:
B4X:
static {
System.loadLibrary("serial_port");
}
public int OpenSerialPort(String port,int baudrate)
{
if(fd >= 0)
{
closeport(fd);
}
fd = openport(port,baudrate);
if(fd < 0)
{
return -1;
}
return 0;
}
Is there a way i'm not loading my library correctly?
Regards,
Tomas