MolotovCherry / kmagick

Kotlin ImageMagick bindings to the MagickWand API
MIT License
40 stars 4 forks source link

[BUG] Library "libkmagick.so" not found #6

Closed GregHib closed 2 years ago

GregHib commented 2 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

A 100% working app example would be far more useful than the current sample directory which is just a repeat of the readme instructions. I've tried changing the name and location of the jni library folder and location of the .so file (libs, jniLibs, jniLibs/arm6-v8a, res, etc...)

Screenshot 2022-05-10 220622

05/10 22:15:34: Launching 'app' on Pixel 3 API 30.
Install successfully finished in 3 s 667 ms.
$ adb shell am start -n "world.gregs.android.receipt/world.gregs.android.receipt.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 27550 on device 'Pixel_3_API_30 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: world.gregs.android.receipt, PID: 27550
    java.lang.UnsatisfiedLinkError: dlopen failed: library "libkmagick.so" not found
        at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
        at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
        at java.lang.System.loadLibrary(System.java:1664)
        at com.cherryleafroad.kmagick.Magick.<clinit>(Magick.kt:12)
        at world.gregs.android.receipt.MainActivity.onCreate(MainActivity.kt:40)
        at android.app.Activity.performCreate(Activity.java:8000)
        at android.app.Activity.performCreate(Activity.java:7984)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I/Process: Sending signal. PID: 27550 SIG: 9
MolotovCherry commented 2 years ago

In your screenshot, libkmagick.so isn't in the same folder as the others.

GregHib commented 2 years ago

In your screenshot, libkmagick.so isn't in the same folder as the others.

It seemingly makes no difference

image

GregHib commented 2 years ago

I take it's probably because I'm using a x86 emulator?

MolotovCherry commented 2 years ago

Can you zip up your project and send it? If it's proprietary, you can create a minimal example which fails.

I take it's probably because I'm using a x86 emulator?

Well, as the arch says, it's arm64-v8a. x86 isn't the same architecture

GregHib commented 2 years ago

Well, as the arch says, it's arm64-v8a. x86 isn't the same architecture

Yeah okay I tried it on a real device and it works fine, windows machines don't support arm64-v8a emulators :(