0

After an unsuccessful install of react-native-image-picker, I am getting build errors in Xcode like...

'React/RCTEventDispatcher.h' file not found

'React/RCTBridgeModule.h' file not found

What's my best route to restoring the project (e.g., getting a successful build)? I have tried Product > Clean.

I'd like to get working on the project again, but need a successful build to do that. The only thing I've done since my last successful build is...

  • Attempt to install and automatically link react-native-image-picker
  • Attempt to install and manually link react-native-image-picker
  • Uninstall and unlink react-native-image-picker
  • Uninstall and unlink react-native-gesture-handler (because this package was mentioned in build errors that appeared after installing react-native-image-picker)
  • Re-install and re-link react-native-gesture-handler

How might these actions result in the build errors I'm seeing? Is there general advice for dealing with "file not found" build errors?

I'm in ExpoKit. The relevant react native version is 0.54.2.

arnoldbird
  • 886
  • 1
  • 13
  • 30
  • Try cleaning the build folder as well. Product > Hold Option > Clean Build Folder – Sean Kladek Jul 24 '18 at 14:36
  • @skladek Thanks for the suggestion! That didn't fix it though. I'm still getting "'React/RCTEventDispatcher.h' file not found" – arnoldbird Jul 24 '18 at 14:39
  • You might want to try nuking the Derived data as well while you are at it. Also how are you getting RN into your project? For ex: CocoaPods? – Vijay Tholpadi Jul 24 '18 at 14:41
  • Also maybe worth looking at https://stackoverflow.com/q/42204295/1740354 ? There have been issue with the imports reported in the past. – Vijay Tholpadi Jul 24 '18 at 14:43
  • @VijayTholpadi When I detached to ExpoKit recently (my first time doing so), the instructions included this step: "Run pod install from your project's ios directory". So I think the answer to your question is that I use CocoaPods. I hadn't used CocoaPods previously. Detaching to ExpoKit went smoothly and the project worked well in Xcode for several days until I attempted the package installs described in my question. Thanks. – arnoldbird Jul 24 '18 at 14:57
  • @VijayTholpadi The code referenced in that other SO question looks relevant, but is not familiar to me, so I take it that is happening on a different level of the framework/package somehow. I'm working in javascript, so I don't know what to do with code like "" – arnoldbird Jul 24 '18 at 14:59
  • @VijayTholpadi After deleting the derived data, I get the same build error: "'React/RCTEventDispatcher.h' file not found". The log references RNGestureHandler, with the relevant package being react-native-gesture-handler. – arnoldbird Jul 24 '18 at 15:15

1 Answers1

0

The solution for me was to undetach from ExpoKit...

https://docs.expo.io/versions/latest/expokit/advanced-expokit-topics.html

...and then detach again...

https://docs.expo.io/versions/latest/expokit/detach

Now I am able to get a successful build in Xcode.

arnoldbird
  • 886
  • 1
  • 13
  • 30