I may have yet another problem with libzgeandroid.so 64 bits.
I managed to build libZgeBullet.so 64 bits quite easily. But When I launch the apk, it crashes. So, after checking the logcat, I tested with the music sunvox.so 64 bits library, which is already used by many. It crashes the same when in 64 bits. And the logcat ends almost the same:
logcat for libZgeBullet:
Code: Select all
08-27 18:55:18.659 E/ZgeAndroid(29835): failed to load: /data/user/0/com.txori.PhysicsTest/lib/./libZgeBullet.so
08-27 18:55:18.660 E/ZgeAndroid(29835): Found JNI_OnLoad function, calling now...
08-27 18:55:19.461 F/DEBUG (29859): x24 00000079095f54b8 x25 0000000000000002 x26 00000079095f5658 x27 0000000000000002
08-27 18:55:19.461 F/DEBUG (29859): x28 0000007fe4e0a310 x29 0000007fe4e05bd0
08-27 18:55:19.461 F/DEBUG (29859): lr 0000007674e75ffc sp 0000007fe4e05bc0 pc 0000007674e76004 pst 0000000060000000
08-27 18:55:19.461 F/DEBUG (29859): backtrace:
08-27 18:55:19.461 F/DEBUG (29859): #00 pc 0000000000035004 /data/app/~~3v20TZq0-ymPVxr6ZxE4GQ==/com.txori.PhysicsTest-xnqPDlVmmFqwnDCSJpPk_A==/lib/arm64/libzgeandroid.so (BuildId: 2bf1c65ded05452cfb3a292fdb6e6f46d841989d)
logcat for sunvox:
Code: Select all
08-27 19:49:35.893 E/ZgeAndroid( 5493): failed to load: /data/user/0/com.txori.sunvox/lib/./libsunvox.so
08-27 19:49:35.893 E/ZgeAndroid( 5493): Found JNI_OnLoad function, calling now...
08-27 19:49:36.406 F/DEBUG ( 5518): uid: 10556
08-27 19:49:36.406 F/DEBUG ( 5518): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xb8
08-27 19:49:36.406 F/DEBUG ( 5518): Cause: null pointer dereference
08-27 19:49:36.406 F/DEBUG ( 5518): x0 0000007920665068 x1 0000000000000000 x2 0000000000000000 x3 0000007fe4e05b70
08-27 19:49:36.406 F/DEBUG ( 5518): x4 00000079206272a0 x5 0000000000000004 x6 0000000000000000 x7 0000000000000000
08-27 19:49:36.406 F/DEBUG ( 5518): x8 5c54747b42ebba55 x9 5c54747b42ebba55 x10 0000000000004001 x11 0000000000000000
08-27 19:49:36.406 F/DEBUG ( 5518): x12 00000079097ca16c x13 0000000000000030 x14 0000000000000105 x15 0000000000000031
08-27 19:49:36.406 F/DEBUG ( 5518): x16 0000007674f82440 x17 0000007909856588 x18 0000007929400000 x19 0000007920665068
08-27 19:49:36.406 F/DEBUG ( 5518): x20 0000007920665068 x21 0000000000000000 x22 0000007920c80c40 x23 0000007fe4e0a440
08-27 19:49:36.406 F/DEBUG ( 5518): x24 00000079095f5558 x25 0000000000000002 x26 00000079095f56f8 x27 0000000000000002
08-27 19:49:36.406 F/DEBUG ( 5518): x28 0000007fe4e0a310 x29 0000007fe4e05bd0
08-27 19:49:36.406 F/DEBUG ( 5518): lr 0000007674f39ffc sp 0000007fe4e05bc0 pc 0000007674f3a004 pst 0000000060000000
08-27 19:49:36.406 F/DEBUG ( 5518): backtrace:
08-27 19:49:36.406 F/DEBUG ( 5518): #00 pc 0000000000035004 /data/app/~~A13jWWzG25xJpbiQVJJXNQ==/com.txori.sunvox-ykhNcg6cnVycsPOj05bXLA==/lib/arm64/libzgeandroid.so (BuildId: 2bf1c65ded05452cfb3a292fdb6e6f46d841989d)
Both are quoting /lib/arm64/libzgeandroid.so, which, by the way, is in 'arm64-v8a' folder, not 'arm64'. I don't know what's going on here, and I already tried adding 'arm64' folder with the 64 libs in it, just in case. Is it possible that we missed something in libzgeandroid that loads the other libraries?
There is
this line in Build/android/jni.pas and another function right under that line.
It is also called from
ZPlatform_Android.inc / Platform_LoadModule
Edit:
I just tried other ways to load the external library in the ZGE project:
Code: Select all
if(ANDROID) this.ModuleName = "./libsunvox.so";
//if(ANDROID) this.ModuleName = "/data/user/0/com.txori.sunvox/lib/armeabi/libsunvox.so";
//if(ANDROID) this.ModuleName = "./arm64-v8a/libsunvox.so";
//if(ANDROID) this.ModuleName = "/data/user/0/com.txori.sunvox/lib/arm64-v8a/libsunvox.so";
Only the first one works in 32 bits mode.
Edit 2:
I added this to Platform_LoadModule function:
AndroidLog(PAnsiChar('AndroidLibraryPath: ' + AndroidLibraryPath));
And both 32 and 64 bits libraries are logging:
AndroidLibraryPath: /data/user/0/com.txori.sunvox/lib/
How does the app know that the libraries are inside 'armeabi' or 'arm64-v8a' folders?