New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to load a pre-built dynamic library along with flutter-tizen app? #430
Comments
Hi. You can create a directory named print('${Platform.environment['AUL_ROOT_PATH']}/res'); Then you can use |
Ah, I think you can just pass the lib name only ( |
@swift-kim Thanks a lot. |
With that, isar works on Tizen 🎈 🥳 Some specific rust steps needed to build the dynamic library. But it works great. |
Glad to hear that! I just looked into https://github.com/isar/isar-core/releases and the binary for Android x86 ( |
Tried using the android x86 binary. Tizen emulator throws up some liblog.so not found on it. Included liblog.so into lib and still it throws the same error.
|
Overall, it's awesome that isar works with Tizen. That's huge... Would be awesome if it is in the list of supported tizen plugins. For that, I tried including that prebuilt For now, it's about including the custom linux_ia32 libisar32.so into tizen build's lib folder and loading it up with |
Hmm, if you don't mind, could you share the binary here? I'd like to do some testing. |
It should be possible to let my app load https://github.com/isar/isar/blob/2.4.0/packages/isar/lib/src/native/isar_core.dart#L44-L45 https://github.com/isar/isar/blob/3.0.0-dev.12/packages/isar/lib/src/native/isar_core.dart#L210-L213 Which version of isar are you using? |
I am using isar 2.5.0 And here, i added a case for linuxIA32 case Abi.linuxIA32:
library = 'libisar_linux_ia32.so';
break;
// and later at line 71
if (library == "libisar_linux_ia32.so")
_IC ??= IsarCoreBindings(DynamicLibrary.open('${Platform.environment['AUL_ROOT_PATH']}lib/$library')); |
I thought the following would work for isar <= 2.4.0 but it didn't. // Load from path.
DynamicLibrary.open('${Platform.environment['AUL_ROOT_PATH']}/lib/libisar.so');
// Load the same library again by name.
// expected: not throws exception
// actual: throws exception
DynamicLibrary.open('libisar.so'); There doesn't seem to be a way to make things work without modifying the isar code itself. Things will become easier if isar provides something similar to sqlite3's |
The main problem for isar to support 32 bit seems to be that binaries for both x86 & arm64 cannot be shipped in a flutter library as stated by the author here.
|
The above example code worked by explicitly setting the library's soname to $ patchelf --set-soname libisar.so tizen/lib/libisar.so but now I see a different error when I click the "Load" button in the quotes sample app. Maybe it's due to a version mismatch or something because I'm using isar 2.4.0 and your binary was built for isar 2.5.0. Thread 26 "io.flutter.ui" received signal SIGABRT, Aborted.
0xb7784a51 in __kernel_vsyscall ()
(gdb) bt
#0 0xb7784a51 in __kernel_vsyscall ()
#1 0xb75ca246 in __libc_signal_restore_set (set=0x9dafb200) at ../sysdeps/unix/sysv/linux/internal-signals.h:84
#2 __GI_raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:48
#3 0xb75b13ce in __GI_abort () at abort.c:79
#4 0xb75b129e in __assert_fail_base (fmt=0xb772c044 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x9e1e4c16 "limit >= 3 - 1", file=0x9e1e415f "mdbx", line=6482,
function=0x9e1f029c "mdbx_pnl_check") at assert.c:92
#5 0xb75c1de6 in __GI___assert_fail (assertion=0x9e1e4c16 "limit >= 3 - 1", file=0x9e1e415f "mdbx", line=6482, function=0x9e1f029c "mdbx_pnl_check") at assert.c:101
#6 0x9e0bc4f6 in ?? () from target:/opt/usr/globalapps/dev.isar.quotes/lib/libisar.so
#7 0x9e1a641c in ?? () from target:/opt/usr/globalapps/dev.isar.quotes/lib/libisar.so Anyway we can now make this into a simple Tizen plugin as shown here. But still it will be a problem if I upgrade isar to 2.5.0. You may ask the isar author if we can add just three lines to the package: case Abi.linuxArm:
case Abi.linuxArm64:
case Abi.linuxIA32: even though the official |
Hmm, it seems you don't even need to call |
That SigAbrt definitely looks like a version mismatch issue. Let me confirm. I'll open a discussion with isar author and see if it can be made possible. Would be awesome to see isar among the list of flutter-tizen supported packages. Will recheck the AUL_ROOT_PATH necessity on my machine. Last time i checked, it couldn't find the binary without it. |
You are right. There's no need to have AUL_ROOT_PATH when flutter_isar_libs_tizen is included. Some things I verified:
|
I have built a specific library for linux_ia32, that samsung tv emulators use. I have that lib.so file. No matter where I put it in the tizen folder, my app says it's nowhere to be found. Is there a specific location I need to put the .so file, or is that simply not possible?
The text was updated successfully, but these errors were encountered: