Skip to content

[tvOS] Compile error with 2.31.0 on tvOS using Xcode 26.4 #4059

@viljamik

Description

@viljamik

Description

There is a compilation error:
node_modules/react-native-gesture-handler/apple/Handlers/RNHoverHandler.m:170:11 'UIHoverGestureRecognizer' is unavailable: not available on tvOS

Image

Could be easily fixed by adding ifdefs for iOS:

--- a/node_modules/react-native-gesture-handler/apple/Handlers/RNHoverHandler.m
+++ b/node_modules/react-native-gesture-handler/apple/Handlers/RNHoverHandler.m
@@ -166,11 +166,13 @@ - (void)setCurrentPointerType:(RNGestureHandlerPointerType)pointerType
 {
   _pointerType = pointerType;
 
+#if TARGET_OS_IOS
   if (@available(iOS 16.1, *)) {
     if (((UIHoverGestureRecognizer *)self.recognizer).zOffset > 0.0) {
       _pointerType = RNGestureHandlerStylus;
     }
   }
+#endif
 }


Steps to reproduce

  1. Try to build any tvOS app using react-native-gesture-handler 2.31.0 on Xcode 26.4.

A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.

https://github.com/software-mansion/react-native-gesture-handler

Gesture Handler version

2.31.0

React Native version

0.84.1

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

New Architecture (Fabric)

Build type

Release mode

Device

Real device

Device model

Apple TV 4K

Acknowledgements

Yes

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions