1

I'm working on a Android Service, which communicate with hardware & applications. I am using a native library to access hardware (libTemp.so). I tested this lib on windows & ubuntu with a java program using JNA.

temperatureHardware = (TempNative) Native.loadLibrary("libTemp.so", TempNative.class);

This is how I connect the *.so lib with the TempNative object. When I try this on Android, I get as follow.

W/linker: /data/app/com.example.kube.tempsystemservice-YUkS9udICA7GsJhTA8fG4A==/lib/arm/libjnidispatch.so: is missing DT_SONAME will use basename as a replacement: "libjnidispatch.so"

Caused by: java.lang.UnsatisfiedLinkError: Unable to load library 'libTemp.so': Native library (android-arm/liblibTemp.so.so) not found in resource path (.)

is this because service can't find the lib file?

I add the lib file as follow...

lib file location image

Champika
  • 65
  • 1
  • 11

1 Answers1

3

try using the library name without the extension.

temperatureHardware = (TempNative) Native.loadLibrary("libTemp", TempNative.class);
samma89
  • 115
  • 9
  • It gave the issue like this : `Caused by: java.lang.UnsatisfiedLinkError: Unable to load library 'Temp': Native library (android-arm/libTemp.so) not found in resource path (.)` – Champika Aug 21 '18 at 11:16
  • You might try passing the absolute path to the library, including filename. – technomage Aug 25 '18 at 23:49