kiwix / java-libkiwix

Libkiwix binding for Java & Kotlin
https://central.sonatype.com/artifact/org.kiwix/libkiwix
GNU General Public License v3.0
3 stars 4 forks source link

Libkiwix is not working below `Android 7.0` #54

Closed MohitMaliFtechiz closed 1 year ago

MohitMaliFtechiz commented 1 year ago

Libkiwix is not working with Android 7(Api level 24) and below. However, our minimum SDK is 21 in java-libkiwix as well as in kiwix-android.

Apart from this, in Android 7 and above the libkiwix is working fine so it might be some compatibility issue with the older version of android.

Logs:

Android 21, Android 22


  E  dlopen("/data/app/org.kiwix.kiwixmobile-1/lib/x86_64/libkiwix.so", RTLD_LAZY) failed: dlopen failed: empty/missing DT_HASH in "/data/app/org.kiwix.kiwixmobile-1/lib/x86_64/libkiwix.so" (built with --hash-style=gnu?)
2023-07-27 12:53:12.044  2814-2814  art                     pid-2814                             E  dlopen("/data/data/org.kiwix.kiwixmobile/app_lib/libkiwix.so", RTLD_LAZY) failed: dlopen failed: empty/missing DT_HASH in "/data/data/org.kiwix.kiwixmobile/app_lib/libkiwix.so" (built with --hash-style=gnu?)
--------- beginning of crash
E  FATAL EXCEPTION: main
Process: org.kiwix.kiwixmobile, PID: 2814
java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH in "/data/data/org.kiwix.kiwixmobile/app_lib/libkiwix.so" (built with --hash-style=gnu?)
at java.lang.Runtime.load(Runtime.java:331)
at java.lang.System.load(System.java:981)
at com.getkeepsafe.relinker.SystemLibraryLoader.loadPath(SystemLibraryLoader.java:31)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:206)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:70)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:51)
at org.kiwix.libkiwix.JNIKiwix.<init>(JNIKiwix.java:30)
at org.kiwix.kiwixmobile.core.di.modules.JNIModule.providesJNIKiwix(JNIModule.kt:29)
at org.kiwix.kiwixmobile.core.di.modules.JNIModule_ProvidesJNIKiwixFactory.providesJNIKiwix(JNIModule_ProvidesJNIKiwixFactory.java:45)
at org.kiwix.kiwixmobile.core.di.modules.JNIModule_ProvidesJNIKiwixFactory.get(JNIModule_ProvidesJNIKiwixFactory.java:36)
at org.kiwix.kiwixmobile.core.di.modules.JNIModule_ProvidesJNIKiwixFactory.get(JNIModule_ProvidesJNIKiwixFactory.java:13)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at org.kiwix.kiwixmobile.core.di.components.DaggerCoreComponent$CoreComponentImpl.jNIInitialiser(DaggerCoreComponent.java:528)
at org.kiwix.kiwixmobile.core.di.components.DaggerCoreComponent$CoreComponentImpl.injectCoreApp(DaggerCoreComponent.java:734)
at org.kiwix.kiwixmobile.core.di.components.DaggerCoreComponent$CoreComponentImpl.inject(DaggerCoreComponent.java:699)
                                                                                                        at org.kiwix.kiwixmobile.core.CoreApp.onCreate(CoreApp.kt:81)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
at android.app.ActivityThread.access$1500(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

Android 23

 FATAL EXCEPTION: main
Process: org.kiwix.kiwixmobile, PID: 3192
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__write_chk" referenced by "/data/data/org.kiwix.kiwixmobile/app_lib/libkiwix.so"...
at java.lang.Runtime.load(Runtime.java:332)
at java.lang.System.load(System.java:1069)
at com.getkeepsafe.relinker.SystemLibraryLoader.loadPath(SystemLibraryLoader.java:31)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:206)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:70)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:51)
at org.kiwix.libkiwix.JNIKiwix.<init>(JNIKiwix.java:30)
at org.kiwix.kiwixmobile.core.di.modules.JNIModule.providesJNIKiwix(JNIModule.kt:29)
at org.kiwix.kiwixmobile.core.di.modules.JNIModule_ProvidesJNIKiwixFactory.providesJNIKiwix(JNIModule_ProvidesJNIKiwixFactory.java:45)
at org.kiwix.kiwixmobile.core.di.modules.JNIModule_ProvidesJNIKiwixFactory.get(JNIModule_ProvidesJNIKiwixFactory.java:36)
at org.kiwix.kiwixmobile.core.di.modules.JNIModule_ProvidesJNIKiwixFactory.get(JNIModule_ProvidesJNIKiwixFactory.java:13)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at org.kiwix.kiwixmobile.core.di.components.DaggerCoreComponent$CoreComponentImpl.jNIInitialiser(DaggerCoreComponent.java:528)
at org.kiwix.kiwixmobile.core.di.components.DaggerCoreComponent$CoreComponentImpl.injectCoreApp(DaggerCoreComponent.java:734)
at org.kiwix.kiwixmobile.core.di.components.DaggerCoreComponent$CoreComponentImpl.inject(DaggerCoreComponent.java:699)
at org.kiwix.kiwixmobile.core.CoreApp.onCreate(CoreApp.kt:81)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
mgautierfr commented 1 year ago

We are compiling the native library with the api 24. This come from this PR https://github.com/kiwix/kiwix-build/pull/547 which was fixing https://github.com/kiwix/kiwix-build/issues/544 We have discuss the upgrade to api24 there and you and @kelson42 agree with this change.

MohitMaliFtechiz commented 1 year ago

Then we need to change the minimum SDK version of kiwix-android to 24.

kelson42 commented 1 year ago

@MohitMaliFtechiz Definitly and immediatly please, this should have been made at that time. Closing as there is nothing much more to do here.

MohitMaliFtechiz commented 1 year ago

@MohitMaliFtechiz Definitly and immediatly please, this should have been made at that time. Closing as there is nothing much more to do here.

@kelson42, Done in https://github.com/kiwix/kiwix-android/pull/3217.