View Single Post
Old 08-01-2024, 12:16 AM   #504
karthikrr
Enthusiast
karthikrr began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Aug 2019
Device: Kobo Aura H2O (N250) / Kobo Aura (N514) / Sony PRS 600
Building from sources

Hi,

I am trying to build KOReader for Android from sources and find myself repeatedly failing. I am relatively new to this whole world, so its probably something stupid I am doing, but after many many hours trying to figure this out I finally gave up and decided to ask for help.

I need an arm64 version with NDKABI 21. I edited the Makefile.defs file in /base - changed arm to arm64 and that was enough to get the build process going with the aarch64 clang. But the apk that is generated, after signing, always failed to install on my Pixel 7a running Lineage 21.

The error reported was that no compatible ABI is found. For some reason, though compiled with aarch64 clang it was reverting to armeabi-v7a in the apk. It took me a good long time to discover that after koreader and crengine were built, luajit-launcher was being built for the wrong architecture.

Eventually I "fixed" this by editing /platform/android/luajit-launcher/Makefile and changing the default to arm64 -

Code:
# Default is build for arm
ANDROID_FULL_ARCH?=arm64-v8a
ARCH?=Arm64
This allowed the build to complete successfully and produced an apk that actually installed on my phone. But when I run the application, it asks for storage permission and after granting it, crashes.

adb logcat analysis shows the following:

Code:
19303 19532 E NativeThread: Failed to run script: /data/user/0/org.koreader.launcher/files/llapp_main.lua:4: module 'libs/libkoreader-lfs' not found:
19303 19532 E NativeThread:  no field package.preload['libs/libkoreader-lfs']
19303 19532 E NativeThread:  no file 'libs/libkoreader-lfs.lua' (checked with asset loader)
19303 19532 E NativeThread:  no file 'libs/libkoreader-lfs.lua'
19303 19532 E NativeThread:  no file '/data/user/0/org.koreader.launcher/files/libs/libkoreader-lfs.lua'
19303 19532 E NativeThread:  no file 'libs/libkoreader-lfs.so'
19303 19532 E NativeThread:  no file '/data/user/0/org.koreader.launcher/files/libs/libkoreader-lfs.so'
Im not sure where to go next! Any help is appreciated.

Thanks,
Karthik
karthikrr is offline   Reply With Quote