1

When I start my application , my app is stopped and in logs I see :

Process: rest.hello.org.rfidtest, PID: 8581
java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app/rest.hello.org.rfidtest-2/lib/arm/liblfrfid.so"

This couse by line :

System.loadLibrary("lfrfid");
Krzysztof Pokrywka
  • 1,356
  • 4
  • 27
  • 50
  • I think your .so is not loaded properly. – D.J Apr 21 '17 at 06:31
  • @DheerubhaiBansal So how I can check this ?or what maybe I can put this ? – Krzysztof Pokrywka Apr 21 '17 at 06:32
  • have you created it or you are using from others. – D.J Apr 21 '17 at 06:33
  • @DheerubhaiBansal I get this projecets but it doesn't works – Krzysztof Pokrywka Apr 21 '17 at 06:35
  • 1
    Check if the so file is where it is expected to be - in "/data/app/rest.hello.org.rfidtest-2/lib/arm/liblfrfid.so" is it there? – Krzysztof Cichocki Apr 21 '17 at 06:39
  • @KrzysztofCichocki in android studio I don't see this but in folder I see this this is a folder : RFIDTest\app\libs\arm – Krzysztof Pokrywka Apr 21 '17 at 06:41
  • this file should be copied into your Andorid device on which you run your application, the path is a path realtive to a "data" folder of your app. Check if it is there, if no, check your build script and read about how to make it go there. I'm not a specialist with copying native libraries to a specified app folder in Android, so I can't help you more. Read how to add native library to an Android Studio project, this might be usefull: http://stackoverflow.com/questions/24357687/how-to-include-so-library-in-android-studio – Krzysztof Cichocki Apr 21 '17 at 06:49
  • JNI_OnLoad is the function in the .so that's called when you call loadLibrary. Its supposed to do any initialization the library needs and possibly load the JNI function table if non-default function mappings are used. Its returning an error. You need to debug into the C code of the library and figure out why. – Gabe Sechan Apr 21 '17 at 07:00
  • @GabeSechan Ok , but I have this project in eclipse and it works corretly but when I want to migrate to android studio it doesn't work – Krzysztof Pokrywka Apr 21 '17 at 07:14
  • @KrzysztofPokrywka You found a solution already? – olajide Nov 29 '20 at 19:12

0 Answers0