Skip to content
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

Embedder loading broken since Linux support was added #419

Closed
jwinarske opened this issue Sep 6, 2024 · 1 comment
Closed

Embedder loading broken since Linux support was added #419

jwinarske opened this issue Sep 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jwinarske
Copy link

jwinarske commented Sep 6, 2024

Description

When running rive package via custom embedder (e.g. Toyota embedder), it fails to load librive_text.so even though it is in the system search path.

The expectation is that librive_text.so is linked to the process. This is true for the Linux GTK embedder, as it links into an executable linking the shared modules. This is not true for custom embedders.

rive-common for Linux case defaults to using

return DynamicLibrary.process();

This only works if librive_text.so is linked to executable at compile time. Otherwise you get this error:

Sep 06 17:27:52 qemux86-64 flutter-auto[473]: [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to lookup symbol 'init': /usr/share/flutter/flutter_ics_homescreen/3.24.1/release/lib/libflutter_engine.so: undefined symbo>
Sep 06 17:27:52 qemux86-64 flutter-auto[473]: #0      DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:33)
Sep 06 17:27:52 qemux86-64 flutter-auto[473]: #1      init (package:rive_common/src/rive_text_ffi.dart:493)
Sep 06 17:27:52 qemux86-64 flutter-auto[473]: #2      initFont (package:rive_common/src/rive_text_ffi.dart)
Sep 06 17:27:52 qemux86-64 flutter-auto[473]: #3      Font.initialize (package:rive_common/rive_text.dart:461)
Sep 06 17:27:52 qemux86-64 flutter-auto[473]: #4      RiveFile.initialize (package:rive/src/rive_file.dart:392)
Sep 06 17:27:52 qemux86-64 flutter-auto[473]: #5      RiveFile._initTextAndImport (package:rive/src/rive_file.dart:414)
Sep 06 17:27:52 qemux86-64 flutter-auto[473]: #6      RiveFile.asset (package:rive/src/rive_file.dart:444)
Sep 06 17:27:52 qemux86-64 flutter-auto[473]: <asynchronous suspension>
Sep 06 17:27:52 qemux86-64 flutter-auto[473]: #7      RiveAnimationState._configure (package:rive/src/widgets/rive_animation.dart:212)
Sep 06 17:27:52 qemux86-64 flutter-auto[473]: <asynchronous suspension>

Expected behavior

if the shared module is present in the LD_LIBRARY_PATH it should load; independent of linking behavior.

Device & Versions (please complete the following information)

  • Device: Embedded Linux
  • OS: Any Linux distro
  • Flutter Version: 3.24.1
@jwinarske jwinarske added the bug Something isn't working label Sep 6, 2024
@jwinarske
Copy link
Author

Two validated workarounds:

  1. Link librive-text.so at build time to embedder
  2. Dynamically load librive-text.so at runtime prior to flutter app running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant