software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
5.85k stars 954 forks source link

'React/RCTEventDispatcher.h' file not found #299

Closed chillyprig closed 3 years ago

chillyprig commented 5 years ago

Here what I found

screen shot 2561-09-30 at 18 18 09

I use expo and eject it.

react-native link works fine

screen shot 2561-09-30 at 18 19 15

pod install works fine

screen shot 2561-09-30 at 18 20 33

Already did config the scheme React

screen shot 2561-09-30 at 18 21 40

Already config Header Search Path

screen shot 2561-09-30 at 18 22 33 screen shot 2561-09-30 at 18 22 53 screen shot 2561-09-30 at 18 23 58

Here is my package.json

screen shot 2561-09-30 at 18 24 54

Now I don't know what to do next. I googled and followed all what I can. Nothing worked.

You guys are my last hope, before I delete React Native project and re-write it all over again with the Pure Native one.

osdnk commented 5 years ago

@chillyprig This issue appears to be quite common. Could you please use Product -> clean and then react-native start --reset-cache

chillyprig commented 5 years ago

Thanks @osdnk I did what you've suggest.

screen shot 2561-10-01 at 21 38 37

The problem still persist in my case. I really appreciated your help.

osdnk commented 5 years ago

Have you tried with legacy build system?

osdnk commented 5 years ago

This issue appears to be inactive. If you still face the problem, please let us know

KaneNguyen commented 5 years ago

This issue appears to be inactive. If you still face the problem, please let us know

Hi @osdnk my issue like @chillyprig "react-native": "^0.57.4", and i'm use cocoapod

gigeos commented 5 years ago

I have the same product because I have pod file and so I have conflict with react from ./node_modules and ./Pods. So I deleted React from Pods and my previous problem was resolved, but now, I don't know what I have to do to resolve this issue

TomBerriot commented 5 years ago

@osdnk Same problem here, clearing every cache I could never resolved my issue.

Though replacing all #import <React/XXX> by #import "XXX" resolves building issues, it is in any way a solution as these files are always suppressed and redownloaded.

There seems to be an issue with how RNGestureHandler access React libraries that others don't have.

Would it be related to the old version of React (0.11.0) added and referenced in Podfile.lock by RNGestureHandler ?

In Podfile.lock

  - React (0.11.0):
    - React/Core (= 0.11.0)
  - React/Core (0.11.0)
  - RNGestureHandler (1.0.12):
    - React

I know little about Swift/Objective-C and Xcode. I've also cleaned Xcode project and rebuild multiple times and this doesn't do anything.

I also tried linking RNGestureHandler manually instead of using react-native link react-native-gesture-handler as suggested in another issue https://github.com/kmagiera/react-native-gesture-handler/issues/179 on the same problem but this did not work for me.

haluong89 commented 5 years ago

same issue here, and I couldn't resolve it. I hope, someone can help me with this:)

osdnk commented 5 years ago

I have found similar issue here: https://github.com/bugsnag/bugsnag-react-native/issues/193#issuecomment-355166756 Could you try following it? @TomBerriot @haluong89

osdnk commented 5 years ago

@haluong89 How about https://github.com/kmagiera/react-native-gesture-handler/issues/179#issuecomment-453034194?

ifyapishore commented 5 years ago

Same issue here: Nothing helps:

Eventually I modified Podfile manually (with all dependencies) and it finally start compiling. I do not publish it because it will definitely will not work for everyone. After that it failed with "jsbundle not found" (and it is actually missing).

Nice :) After week of nightmare I have no clue why it stop working in first place and what to do next.

scarlac commented 5 years ago

This is likely caused by the project not being linked with React Native properly. I believe this is a bug in this project, not with your code. I could be wrong, but...

Solution: Go in and add React Native as a dependency manually, clean, and rebuild the RNGestureHandler target manually.

Here's a guide to doing it: https://github.com/facebook/react-native/issues/11721#issuecomment-270672904

SteffeyDev commented 5 years ago

I was able to fix this by adding the following to my ios/Podfile:

pod 'React', :path => '../node_modules/react-native', :subspecs => [
  'Core',
  'CxxBridge',
  'DevSupport',
  'RCTText',
  'RCTNetwork',
  'RCTWebSocket',
  'RCTAnimation',
  # Add any other subspecs you want to use in your project
]
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

# Third party deps podspec link
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

When I ran pod update, I noticed this: Installing React 0.58.0-rc.2 (was 0.11.0) This means that @TomBerriot was correct about the old react version, and if you don't manually specify the React pod in your Podfile, it will try to use the older version of React, which doesn't allow for the <React/RCTEventDispatcher.h> syntax.

naoey commented 5 years ago

I can confirm that @SteffeyDev 's solution worked for me as well. None of the other solutions work. It seems that this is indeed to do with an outdated version of the React Pod being installed.

brave-coder9 commented 4 years ago

Follows works good.

karenerobinson commented 4 years ago

I have this problem but when I modify the Podfile per @SteffeyDev's comment I get:

[!] No podspec found forReactin./node_modules/react-native`

What's supposed to put the podspec into the node_modules folder? Do I need to add something to npm's package.json ?

naoey commented 4 years ago

@karenerobinson are you sure you've added the path to the podspec correctly? Your log says ./node_modules/react-native, when in a standard RN project structure the path to node_modules would be a level above the Podfile which would make it ../node_modules/react-native

blueturtle13g commented 4 years ago

Follows works good.

  • remove Pods, Podfile.lock
  • remove pod RNGestureHandler in Podfile
  • pod install and then Build!

I can't believe it, but just your solution solved my problem thanks man!

hugoh59 commented 4 years ago

The app is likely to crash at some point if you remove RNGestureHandler.

justinsymph commented 4 years ago

Screenshot 2019-09-16 at 3 23 21 PM

I tried every solution out there, but still, no luck fixing this. Using version: "react-native-gesture-handler": "1.4.1"

ferrannp commented 4 years ago

I was facing this same issue yesterday when updating from react-native-gesture-handler 1.0.16 to 1.5.0. In the past I linked react-native-gesture-handler with react-native link (even that I have pods too). What I did is run react-native unlink react-native-gesture-handler and then I add it into pods:

pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'

That might be useful for anyone landing here :)

ue commented 4 years ago

upgrading with rn +60 to the latest "react-native-gesture-handler": "^1.5.2" version solution. Do not put into your podfile! If you add that already just remove.

Follow these steps; Go Libraries folder from remove RnGesutreHandler.xscodeproj Go header search under build settings remove GestureHanler paths which is related GestureHandler Go general section remove libRNGestureHandler from Frameworks and libraries

dean-scott commented 4 years ago

@ferrannp fix worked for me. Thanks, I was pulling out my hair.

jakub-gonet commented 3 years ago

Should be resolved in newer versions.

BatDroid commented 3 years ago

I still had this issue with a legacy code that was given to me... I removed the gesture handler lib from Link Binary with Libraries and kept the podfile and it's working now

haveamission commented 2 years ago

@jakub-gonet I'm still seeing it on 1.10.2

rabiaah commented 2 years ago

Same issue still here

"react-native-gesture-handler": "~1.10.2",

node_modules/expo-modules-core/ios/NativeModulesProxy/EXNativeModulesProxy.m:9:9: 'React/RCTEventDispatcherProtocol.h' file not found

image

dfabreguette commented 2 years ago

I also have the problem since today, as I ugpraded my platform to ios 12 and updated expo-modules-core. Any idea how I can solve that ?

Capture d’écran 2021-11-22 à 12 37 39
ghost commented 2 years ago

Any ideia on how to solve it?

dfabreguette commented 2 years ago

@reisvini1 In case it can help, I solved the issue by downgrading expo SDK to v41 (as it was before upgradeing). This expo SDK version does not use expo-core-modules.

YahyaBagia commented 2 years ago

Any updates on this ? I have the exact same problem..

I also have the problem since today, as I ugpraded my platform to ios 12 and updated expo-modules-core. Any idea how I can solve that ? Capture d’écran 2021-11-22 à 12 37 39

rabiaah commented 2 years ago

The solution from my side was as below:

I've run the below to upgrade the expo-cli

sudo npm install --global expo-cli cd ios Remove the Podfile.lock file. pod install

Recommendation is to do reboot and retry again.

ghost commented 2 years ago

Solve it by upgrading the project to use EAS build instead of bare workflow.

zain-khalid commented 1 year ago

I got the same issue. Here is the solution that work for me.

My React Native version is 0.63.4. As mentioned in https://www.npmjs.com/package/react-native-blob-util that the latest version is not compatible for react native version less than 0.65.X.

DO This react-native-blob-util : 0.17.2 -> 0.16.5

pod clean pod install

clean build folder and install the app