Skip to content

TVOS Crash when using native stack header search bar #2003

@Duell10111

Description

@Duell10111

Description

When I add a header search bar to a screen on tvOS the app crashes as passing nil to UISearchController is not supported on tvOS.

Documentation of Apple.
https://developer.apple.com/documentation/uikit/uisearchcontroller/1618647-init

Exception:
Exception NSException * "Passing nil to -[UISearchController initWithSearchResultsController:] is not supported on this platform." 0x0000600000d54330

Steps to reproduce

  1. Add headerSearchBar to screen on tvOS
  2. Navigate to Screen with headerSearchBar

Basically adding this to a screen and opening screen on tvOS.
image

Snack or a link to a repository

https://github.com/Duell10111/ReactTube/tree/react-native-screen-search-bar-issue-tvos

Screens version

4.29.0

React Native version

0.72

Platforms

tvOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

None

Device

iOS simulator

Device model

Apple TV 4K

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: tvOSIssue related with tvOS compatibilityRepro providedA reproduction with a snack or repo is provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions