Skip to content

rive 0.14.3 - Does not render in golden tests with renderer flutter #495

@JulianBissekkou

Description

@JulianBissekkou

Edit: I updated the title of the issue after clarifying that the used renderer (rive) should not be used for golden tests. However, there is still a bug that the rendering does not work by using the proposed flutter renderer.

Description

When running an golden or widget test that includes a rive widget the test fails with the following error:

00:02 +0: MyApp Golden Tests MyApp should match golden file                                                                               Shell: Assertion failed: (factory), function File, file file.cpp, line 170.
unhandled error during finalization of test:
/Users/julianbissekkou/Downloads/rive_example/test/golden/my_app_golden_test.dart
TestDeviceException(Shell subprocess crashed with SIGABRT (-6).)
#0      FlutterTesterTestDevice.finished (package:flutter_tools/src/test/flutter_tester_device.dart:254:5)
<asynchronous suspension>
#1      FlutterTesterTestDevice.kill (package:flutter_tools/src/test/flutter_tester_device.dart:236:5)
<asynchronous suspension>
#2      FlutterPlatform._startTest.<anonymous closure> (package:flutter_tools/src/test/flutter_platform.dart:696:9)
<asynchronous suspension>
#3      FlutterPlatform._startTest.finalize (package:flutter_tools/src/test/flutter_platform.dart:597:11)
<asynchronous suspension>
#4      FlutterPlatform._startTest (package:flutter_tools/src/test/flutter_platform.dart:769:7)
<asynchronous suspension>

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create a simple page that displays a rive widget
  2. Create a golden test for that page
  3. Run the golden test
  4. See error ⚠️

Source .riv/.rev file

You can use any riv file that you want. In my example I just used this one that I found in some example repo online.
https://cdn.rive.app/animations/vehicles.riv

Expected behavior

No crash, golden image gets rendered

Screenshot

Device & Versions (please complete the following information)

e.g.:

[✓] Flutter (Channel stable, 3.32.5, on macOS 15.5 24F74 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] IntelliJ IDEA Community Edition (version 2025.1.1.1)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

Additional context

I created a repository with an example right here:
https://github.com/JulianBissekkou/rive_golden_issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions