react-native-gesture-handler: RNGestureHandlerManager.h:9:52: error: expected a type - eventDispatcher:(nonnull RCTEventDispatcher *)eventDispatcher;

Description

Cannot build iOS app after upgrading from RN version 0.63.2 to 0.65.0-rc.3. I am getting this error:

In file included from /Users/…/ReactNativeProjects/…/node_modules/react-native-gesture-handler/ios/RNGestureHandlerManager.m:1: /Users/…/ReactNativeProjects/…/node_modules/react-native-gesture-handler/ios/RNGestureHandlerManager.h:9:52: error: expected a type eventDispatcher:(nonnull RCTEventDispatcher *)eventDispatcher;

Problem is in RNGestureHandlerManager.h, on the line below:

- (nonnull instancetype)initWithUIManager:(nonnull RCTUIManager *)uiManager
                          eventDispatcher:(nonnull RCTEventDispatcher *)eventDispatcher;
gh1

Edit: When I upgrade to RNGestureHandler version 1.10.3 I get the errors below: Screen Shot 2021-08-11 at 22 00 54

Steps To Reproduce

  1. Upgrade to the latest version of RN and try to build the app.

Expected behavior

The app should build successfully.

Actual behavior

Build fails.

Snack or minimal code example

Package versions

react-native-gesture-handler@1.4.1 react-native@0.65.0-rc.3 XCode: 12.2

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 16 (1 by maintainers)

Most upvoted comments

#import <React/RCTEventDispatcher.h> solved for me

To Solve:

yarn upgrade react-native-gesture-handler
cd ios
pod install

Most likely you installed react-native-gesture-handler with react-navigation so it’s using an older version unsupported by RN update.

@LBojanic - where did you make that change?

At the top of the same file. in RNGestureHandlerManager.h

If I’m not wrong, I’ll have to do this every time I have a clean build right ? Could you please tell me what the permanent solution to this issue is ? I’m facing this after upgrading from 0.63.3 to 0.64.2. My gesture handler version is 1.6.0

@aditya-keri-betterhalf look at this file https://github.com/software-mansion/react-native-gesture-handler/blob/master/ios/RNGestureHandlerManager.h it has @class RCTEventDispatcher; so you upgrading should fix it but if you are using any other libraries that requires a specific version of gesture handler that upgrading will not work.

I am experiencing the same issue. Tried to remove pods and cleaning the build folder - didn’t help. Also tried upgrading package with no succes