Skip to content

[BUG] App crashes on background/foreground transition when using ViroVideo #478

Description

@bhoken94

Description
There is a critical issue where the application crashes consistently when a ViroVideo component is present in the scene and the app transitions to the background and back to the foreground.

In addition to the crash, we observed inconsistent behavior suggesting potential memory leaks or improper scene reference handling, as crashes sometimes occur even without active markers in the scene. This issue is distinct from the 16KB-alignment discussion currently ongoing.

Reproduction
A reproduction repository has been prepared here: bhoken94/expo-starter-kit-typescript

Steps to reproduce:

  1. Clone the repository.
  2. Add ar_marker.jpg and video_test.mp4 to the /assets directory (required for the demo scene).
  3. Run the application on a physical device.
  4. Navigate to the video scene.
  5. Send the app to the background.
  6. Bring the app back to the focus/foreground.

Note: The crash occurs even if the video is not actively playing; the mere presence of the component in the scene seems to trigger the failure during the lifecycle transition.

Expected Behavior
The app should handle background/foreground transitions gracefully, pausing the video or maintaining the scene state without crashing.

Actual Behavior
The app terminates unexpectedly (crashes) during the lifecycle change.

Environment
Library: ViroReact / Expo Starter

Version: Latest (tested against the most recent release)

Platform: Android

Additional Context
We suspect the issue might be related to how the scene context or the video player instance is managed by the bridge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    to be releasedIt's fixed/done and coming in a next update

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions