Hello All, i'm trying to write a wrapper for a friend and it requires me to load two .so library riles.
I'am using the following;
However when i try the library i get the following error.
Does anyone know why this is, or how can i fix this issue?
I've also tried copying the .so files to the File.DirDefaultExternal directory, and then load the files like this:
When i do this i get this other error:
I hope someone can help me figure out this problem, i have done other libraries in the past and I have been able to succesfully load the .so libraries, i'm not sure if this is an issue only related to L version, unfortunately i do not have a device with an older android version so that I can test on, If anyone has any advice or thoughts on this please let me know.
Thanks,
Walter
I'am using the following;
B4X:
System.loadLibrary("ctrl_gpio")
However when i try the library i get the following error.
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app/com.genesis.androidpos-2/lib/arm/libctrl_gpio.so"
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:989)
at com.genesis.androidpos.Android_POS.TurnOnPrinter(Android_POS.java:45)
at com.genesis.androidpos.main._button1_click(main.java:403)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:77)
at android.view.View.performClick(View.java:4764)
at android.view.View$PerformClick.run(View.java:19844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
Does anyone know why this is, or how can i fix this issue?
I've also tried copying the .so files to the File.DirDefaultExternal directory, and then load the files like this:
B4X:
System.load(File.Combine(File.getDirDefaultExternal(), "libctrl_gpio.so"));
When i do this i get this other error:
** Activity (main) Create, isFirst = true **
Copying Files from :/storage/emulated/0/Android/data/com.genesis.androidpos/files libctrl_gpio.so
java.lang.UnsatisfiedLinkError: dlopen failed: couldn't map "/storage/emulated/0/Android/data/com.genesis.androidpos/files/libctrl_gpio.so" segment 1: Permission denied
at java.lang.Runtime.load(Runtime.java:331)
at java.lang.System.load(System.java:982)
at com.genesis.androidpos.Android_POS.Initialize(Android_POS.java:37)
at com.genesis.androidpos.main._activity_create(main.java:349)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at com.genesis.androidpos.main.afterFirstLayout(main.java:100)
at com.genesis.androidpos.main.access$100(main.java:17)
at com.genesis.androidpos.main$WaitForLayout.run(main.java:78)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
I hope someone can help me figure out this problem, i have done other libraries in the past and I have been able to succesfully load the .so libraries, i'm not sure if this is an issue only related to L version, unfortunately i do not have a device with an older android version so that I can test on, If anyone has any advice or thoughts on this please let me know.
Thanks,
Walter