Skip to content

Rive animations freezing after initial few seconds and not correctly receiving pointer [Flutter] #496

@sakshitporwal

Description

@sakshitporwal

Rive Animation Freezing Issue Report

Issue Summary

Title: New Files created on editor v0.8.3243 are freezing in a few seconds on Android and Windows & on window resize on Windows

Environment Information

Flutter & Dart Version

[√] Flutter (Channel stable, 3.32.7, on Microsoft Windows [Version 10.0.26200.5710], locale en-IN)
[√] Windows Version (11 Home Insider Preview Single Language 64-bit, 25H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2022 17.14.2)
[√] Android Studio (version 2022.3)
[√] VS Code (version 1.102.1)
[√] Connected device (4 available)
[√] Network resources

Dependencies

  • Rive Version: ^0.14.0-dev.3 (Latest dev version)
  • Flutter UI Framework: Fluent UI ^4.12.0
  • Target Platforms: Android, Windows

Rive Editor Version

  • Editor Version: v0.8.3243

Problem Description

Symptoms

  1. Android Platform: Rive animations freeze after a few seconds of running
  2. Windows Platform:
    • Animations freeze after a few seconds of running
    • Additional freezing occurs on window resize events
  3. Timing: Issue appears consistently within seconds of animation start
  4. Scope: Affects new files created with Rive editor v0.8.3243

Current Implementation

The issue occurs in the StoreStage widget which loads a Rive animation:

// File: lib/screens/windows/store_module/store_stage.dart
final fileLoader = rive.FileLoader.fromAsset(
  'assets/rive/dash.riv',
  riveFactory: rive.Factory.rive,
);

return rive.RiveWidgetBuilder(
  fileLoader: fileLoader,
  builder: (context, state) => switch (state) {
    rive.RiveLoading() => const Center(child: ProgressRing()),
    rive.RiveFailed() => Center(/* Error handling */),
    rive.RiveLoaded() => rive.RiveWidget(
        controller: state.controller,
        fit: rive.Fit.fill,
      ),
  },
);

Steps to Reproduce

Prerequisites

  1. Install Flutter 3.32.7 (stable channel)
  2. Add rive: ^0.14.0-dev.3 to pubspec.yaml
  3. Create a new Rive file using Rive editor v0.8.3243 with align taget on pointer move
  4. Set up a Flutter project targeting Android and/or Windows

Reproduction Steps

For Android:

  1. Setup:

    flutter create rive_test_app
    cd rive_test_app
  2. Add Rive dependency:

    # pubspec.yaml
    dependencies:
      flutter:
        sdk: flutter
      rive: ^0.14.0-dev.3
  3. Create assets folder:

    mkdir assets
    mkdir assets/rive
  4. Add Rive asset created with editor v0.8.3243 to assets/rive/

  5. Update pubspec.yaml:

    flutter:
      assets:
        - assets/rive/
  6. Implement the widget:

    // Create a widget similar to StoreStage with RiveWidgetBuilder
    // Load the animation using FileLoader.fromAsset
    // Use RiveWidget with Fit.fill
  7. Run on Android device:

    flutter run -d android
  8. Observe: Animation plays for a few seconds then freezes

For Windows:

  1. Follow steps 1-6 from Android setup

  2. Run on Windows:

    flutter run -d windows
  3. Test scenarios:

    • Launch app and observe animation freezing after few seconds
    • Resize window during animation playback
    • Observe additional freezing on window resize events

Expected Behavior

  • Rive animations should play smoothly and continuously
  • Window resize events should not cause animation freezing
  • Animations should maintain consistent performance across platforms

Actual Behavior

  • Animations freeze after 2-5 seconds of playback
  • Windows platform shows additional freezing on resize
  • Issue is consistent across different devices and emulators

Additional Information

Project Structure

lib/
├── screens/
│   └── windows/
│       └── store_module/
│           └── store_stage.dart  # Widget containing the Rive animation
assets/
├── rive/
│   ├── weather.riv              # Main problematic animation file
│   ├── bg_test.riv
│   ├── dash.riv
│   ├── interactive_blur_waves.riv
│   ├── number4.riv
│   └── untitled.riv

Workarounds Attempted

  • Tried different Fit options (cover, contain, fill, etc.)
  • Tested with different Rive file formats
  • Attempted manual controller management
  • Tested on multiple devices/emulators

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