5

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;

enter image description here

When I upgrade to RNGestureHandler version 1.10.3 I get the errors below:

Undefined symbol: OBJC_CLASS$_RCTScrollView

Undefined symbol: OBJC_METACLASS$_RCTViewManager

Undefined symbol: OBJC_CLASS$_RCTEventEmitter

Undefined symbol: __RCTNotImplementedException

Undefined symbol: _RCTGetUIManagerQueue

Undefined symbol: OBJC_CLASS$_RCTConvert

Undefined symbol: _RCTRegisterModule

Undefined symbol: _RCTDefaultLogFunction

Undefined symbol: OBJC_CLASS$_RCTRootView

Undefined symbol: OBJC_METACLASS$_RCTEventEmitter

Undefined symbol: OBJC_CLASS$_RCTTouchHandler

Undefined symbol: OBJC_CLASS$_RCTViewManager

Undefined symbol: __RCTLogNativeInternal

It has been 3 days since I submitted the issue on the github page but no response from the team. I would really appreciate any help. Any ideas are welcome! This has really started to bother me.

Here is a link to the issue I created on github: https://github.com/software-mansion/react-native-gesture-handler/issues/1543

Thanks a lot...

enter image description here

honor
  • 7,378
  • 10
  • 48
  • 76

4 Answers4

6

Alright. After a couple of days of reading/digging and trying many different solutions this is how I fixed it.

1- Added the import statement below in RNGestureHandlerManager.h

#import <React/RCTEventDispatcher.h>

When I tried to re-build the app, this created the same Undefined symbol errors as if I had updated the RNGestureHandler version to 1.10.3 (see the red error messages in the question).

2- Here is the critical part.

I checked "ONLY_ACTIVE_ARCH" setting under Build Settings of the main project target. It was 'YES' for both debug and release modes.

enter image description here

Then I checked the same settings for RNGestureHandler package inside the Pods project. In my case, it was YES for debug and NO for release. I was trying to build the app in Release mode so I changed this setting to YES for release mode for the RNGestureHandler package.

Then I tried building my app again. This time the Undefined symbol errors for the RNGestureHandler package were gone. Similar messages started to show up for other packages. I did the same settings update for all the packages that created these Undefined symbol errors and finally, my app was built successfully in release mode! Hope this helps.

honor
  • 7,378
  • 10
  • 48
  • 76
0

react-native-gesture-handled lib was upgraded and the fix is included, so upgrading the library will fix it.

khpa
  • 79
  • 1
  • 6
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/29890405) – teunbrand Sep 22 '21 at 14:03
  • ... you clearly didn't understand my reply which was an answer.... although I've referred to the post above... – khpa Nov 06 '21 at 16:06
0

This was fixed in a newer version of the lib.

In your package.json file, change the version of the react-native-gesture-handler lib to ~2.5.0 or higher. Then run yarn or npm i, followed by cd ios && pod install.

instanceof
  • 1,404
  • 23
  • 30
0

I tried various ways of cleaning and reinstalling as well as deleting Xcode derived data and nothing worked. What fixed it for me was...

cd ios
pod deintegrate
pod setup
pod install

See related issue: https://github.com/software-mansion/react-native-gesture-handler/issues/179