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

Unable to use Rive in widget tests #417

Closed
WilliamKarolDiCioccio opened this issue Aug 28, 2024 · 2 comments
Closed

Unable to use Rive in widget tests #417

WilliamKarolDiCioccio opened this issue Aug 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@WilliamKarolDiCioccio
Copy link

Description

When running my widget tests those making use of rive-flutter fail with the following console output:

00:01 +0 -1: loading C:/Users/***/Desktop/open_local_ui/app/test/frontend/rive_animation_test.dart [E]
  Failed to load "C:/Users/***/Desktop/open_local_ui/app/test/frontend/rive_animation_test.dart":
  Invalid argument(s): Failed to load dynamic library 'rive_common_plugin.dll': The specified module could not be found.
   (error code: 126)
  dart:ffi                                                   new DynamicLibrary.open
  package:rive_common/src/dynamic_library_helper.dart 47:29  RiveDynamicLibraryHelper.open
  package:rive_common/src/dynamic_library_helper.dart 14:43  RiveDynamicLibraryHelper.nativeLib
  package:rive_common/src/dynamic_library_helper.dart        RiveDynamicLibraryHelper.nativeLib
  package:rive_common/src/rive_text_ffi.dart 10:59           _nativeLib
  package:rive_common/src/rive_text_ffi.dart 491:5           init
  package:rive_common/src/rive_text_ffi.dart                 init
  package:rive_common/src/rive_text_ffi.dart 808:3           initFont
  package:rive_common/rive_text.dart 461:7                   Font.initialize
  package:rive/src/rive_file.dart 392:33                     RiveFile.initialize
  test\frontend\rive_animation_test.dart 9:18                main


To run this test again: C:\tools\flutter\bin\cache\dart-sdk\bin\dart.exe test C:/Users/***/Desktop/open_local_ui/app/test/frontend/rive_animation_test.dart -p vm --plain-name "loading C:/Users/***/Desktop/open_local_ui/app/test/frontend/rive_animation_test.dart"
00:01 +0 -1: Some tests failed.

The problem seems to be related to the rive_common_plugin DLL not being found during test runs despite being correclty built and present in the build directories (both debug and release). The issue does not show up during normal flutter runs both on Linux and Windows. I'm running the latest rive release an the latest stable flutter release.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Try to write any widget unit test around Rive

Expected behavior

The test should succeed or fail without any rive-flutter related errors but rather my own errors.

Device & Versions (please complete the following information)

  • Device: PC
  • OS: Windows 11 Pro
  • Flutter Version:
Flutter 3.24.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 80c2e84975 (4 weeks ago) • 2024-07-30 23:06:49 +0700
Engine • revision b8800d88be
Tools • Dart 3.5.0 • DevTools 2.37.2
@WilliamKarolDiCioccio WilliamKarolDiCioccio added the bug Something isn't working label Aug 28, 2024
@HayesGordon
Copy link
Contributor

We're working on resolving this with the next major version that will change how the underlying native libraries are built. Closing this issue as a duplicate of #354

More information there.

@WilliamKarolDiCioccio
Copy link
Author

Thanks. Did't find that by Googling

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

2 participants