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

Cannot run rive-flutter tests with flutter 3.27.1 on main branch #446

Closed
mikeesouth opened this issue Dec 25, 2024 · 4 comments
Closed

Cannot run rive-flutter tests with flutter 3.27.1 on main branch #446

mikeesouth opened this issue Dec 25, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@mikeesouth
Copy link

Description

I'm trying to run flutter test on the rive-flutter repo (main branch). I get this error:
RiveFile.import called before RiveFile.initialize() for most of the tests.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Clone main branch of rive-flutter
  2. Run flutter test
  3. See error: RiveFile.import called before RiveFile.initialize()

Source .riv/.rev file

Not needed, happens for all tests.

Expected behavior

That the tests pass.

Screenshots

Not applicable.

Device & Versions (please complete the following information)

  • Device: flutter test
  • OS: Running om Mac OS 15.1 with an M1 CPU
  • Flutter Version:
Flutter 3.27.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 17025dd882 (9 days ago) • 2024-12-17 03:23:09 +0900
Engine • revision cb4b5fff73
Tools • Dart 3.6.0 • DevTools 2.40.2

Additional context

Even if I add RiveFile.initialize() I get the following error (that is also reported as #354 and some other related issues):

══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following ArgumentError was thrown running a test:
Invalid argument(s): Failed to lookup symbol 'init': dlsym(RTLD_DEFAULT, init): symbol not found

When the exception was thrown, this was the stack:
#0      DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:33:70)
#1      init (package:rive_common/src/rive_text_ffi.dart:497:16)
#2      init (package:rive_common/src/rive_text_ffi.dart)
#3      initFont (package:rive_common/src/rive_text_ffi.dart:814:3)
#4      Font.initialize (package:rive_common/rive_text.dart:463:7)
#5      RiveFile.initialize (package:rive/src/rive_file.dart:392:33)
#6      main.<anonymous closure> (file:///Users/mickesoderman/development/git/rive-flutter/test/rive_animation_test.dart:139:20)
#7      testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:189:29)
<asynchronous suspension>
#8      TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:1027:5)
@mikeesouth mikeesouth added the bug Something isn't working label Dec 25, 2024
@HayesGordon
Copy link
Contributor

The RiveFile.import called before RiveFile.initialize() is a warning and not an error. Mostly a consideration for use in production. For tests, it's not necessary to call RiveFile.initialize() unless you want to get rid of the warning.

The error you're getting is because the dynamic library does not exist for the tests to use. This issue provides relevant information and instructions for building it locally.

Please note that we will be improving this soon once Rive Flutter switches to using the new rive_native package.

Closing this for now as a duplicate.

@Solido
Copy link

Solido commented Jan 13, 2025

Any large estimation when rive_native could hit first alpha? @HayesGordon
Thanks.

@HayesGordon
Copy link
Contributor

@Solido we have a test release out to validate our build process, etc. https://pub.dev/packages/rive_native

We're working on finalizing the missing platforms and API

@Solido
Copy link

Solido commented Jan 15, 2025

Pardon my enthusiasm ;)

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

3 participants