Skip to content

traverseForScrollView crash with AVPlayer [iOS 17.2 BETA 1] #1967

@KrzysztofMoch

Description

@KrzysztofMoch

Description

iOS 17.2 beta 1 seems to crashing when using any implementation of AVPlayer with react-native-screens. Issue occurs only when we are using native controls

Some informations

In new iOS beta (17.2 beta 1) Apple add new UI element to AVPlayer hierarchy

Screenshot 2023-11-10 at 15 10 24

When we are navigating away from screen, react-native-screens calls traverseForScrollView and when we are reaching it, it's throwing error that crash app

Error Message

*** -[__NSArray0 objectAtIndex:]: index 0 beyond bounds for empty array

Workaround

We can temporarily catch
Screenshot 2023-11-10 at 15 21 40
with "try catch", but it is not a very good solution because in the future we may miss some "important" error

I think we should wait for next iOS release - If this don't get fixed the next step would be to detect if you are in AVPlayer and if so do not call the function

Steps to reproduce

To reproduce this issue we need to install xcode 15.1 beta 2 and iOS 17.2 sumulator.

Steps:

  1. Open provided example app
  2. Wait for video to load
  3. Navigate away from screen
  4. Application will crash

Snack or a link to a repository

https://github.com/abanobmikaeel/react-native-video-crash/

Screens version

3.27.0

React Native version

0.72.6

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo bare workflow

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

Any

Acknowledgements

Yes

Metadata

Metadata

Assignees

Labels

Missing reproThis issue need minimum repro scenarioPlatform: iOSThis issue is specific to iOS

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions