question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Seek video on iOS with react-native-reanimated cause randomly crash at launch and in release mode only

See original GitHub issue

Bug

When the app launch first time and we’re trying to seek video, the app can(not always) crash with no error.

Debugging with sentry show:

C++ Exception RNSScreen N5folly4json11print_errorE

Debugging from xCode console show:

libc++abi: terminating with uncaught exception of type folly::json::print_error: folly::toJson: JSON object value was an INF when serializing value at "playableDuration"

When not trying to seek video, or remove react-native-reanimated app stops crashing.

Platform

Which player are you experiencing the problem on:

  • iOS

Environment info

React native info output:

System:
    OS: macOS 11.6.1
    CPU: (8) arm64 Apple M1
    Memory: 302.91 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.1 - /usr/local/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 8.1.2 - /usr/local/bin/npm
    Watchman: 2021.12.06.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: Not Found
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0
    Android SDK:
      API Levels: 28, 29, 30, 31
      Build Tools: 29.0.2, 30.0.2, 31.0.0
      System Images: android-29 | ARM 64 v8a, android-29 | Intel x86 Atom_64, android-29 | Google APIs ARM 64 v8a, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play ARM 64 v8a, android-31 | Google APIs ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7784292
    Xcode: 13.1/13A1030d - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.65.1 => 0.65.1 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Library version: x.x.x

Steps To Reproduce

  1. Isntall react-native-video and react-native-reanimated v2.3.1
  2. Launch app react-native run-ios
  3. On App.js mount and video loaded call this.videoRef?.seek(x)

Expected behaviour

  1. To not catch crash, especially with no errors

Reproducible sample code

onLoad() {
     this.videoPlayerRef.seek(...);
  }

<Video
     {...props}               
    onLoad={onLoad}
/>

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:11

github_iconTop GitHub Comments

2reactions
pasteancommented, Jan 6, 2022

Confirming that the issue is in the calculatePlayableDuration function, we’ve removed all the code (function + call) a couple of days ago and it just got through QA.

1reaction
antoinemaillardcommented, May 3, 2022

Yes @yedidyak , for us it worked (no more crashes)

Read more comments on GitHub >

github_iconTop Results From Across the Web

app crashes at launch as release b… | Apple Developer Forums
I have imported ios-charts in my Objective-C project, and running it in debug mode is fine. However, today I tried to archive and...
Read more >
App is crashing in release mode only - ios - Stack Overflow
i think it will help for you, got to project build phases -> Link binary with libraries -> change all library frame works...
Read more >
How to Fix Crashing Apps on an iPhone or Android?
Update App To The Last Version, The App Crash Fixer. Sometimes app-crashing is not caused by your phone, but rather the app itself....
Read more >
[Top 7 Ways] Fix iPhone Apps Keep Crashing on iOS 16
Way 1: Force Quit the Crashed App and Re-Launch · Way 2: Restart your iPhone · Way 3: Update Crashed Apps · Way...
Read more >
How to Fix Counter-Strike Global Offensive Crashes
This popular and exciting PC game is a blast. However, it experiences crashes, mostly on Windows 10. If you're looking for ways to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found