Closed ikzjfr0 closed 5 years ago
@ikzjfr0, Did you try 'Product->Clean' in Xcode and then build again?
@osdnk yes plus deleting whole folder of Xcode/DerivedData and reboot my Macbook
The error is removed after I changed from #import <React/RCTEventDispatcher.h>
to #import "RCTEventDispatcher.h"
.
However, I don't think it's a good way to do this since I also need to changes hundreds of files from <React/xxxx.h>
to "xxxx.h"
Ideally, i think, it's better to use cocoapod way, rather than react-native link
Seems we supports cocoapod since i can find out this: https://github.com/kmagiera/react-native-gesture-handler/blob/master/ios/RNGestureHandler.podspec
I tried to include following in podfile but got an error after pod install
:
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
@ikzjfr0
I cannot manage to reproduce your issue.
I made a new project react-native init
, then: yarn add react-native-gesture-handler
and: react-native link react-native-gesture-handler
and find it workable.
I also did change versions of react and RN to be exactly same as yours and build again the project and everything seems to be fine. Would you like to give me the link to repository with sample to project that shows your problem? Would you mind adding version of Xcode you use?
@ikzjfr0 I published 1.0.1 that includes #186
Do you mind trying that to see if it fixes your problem? If so we would like to close this issue.
I still failed to use react-native link react-native-gesture-handler
and got the same error as above. However, I managed to use cocoapod: pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler/ios
, hope this is another right way to do that.
Moreover, i come to another issue (somebody else feedback this too) : https://github.com/react-native-community/react-native-tab-view/issues/408. I guess this could be potentially related to above issue too. react-native-tab-view
is using react-native-gesture-handler
as native drive.
As it's the only issue describing such a problem and we cannot reproduce it, we consider it's related to https://github.com/react-native-community/react-native-tab-view/issues/408. If you still face the problem and haven't found a proper workaround, please reopen the issue
Still getting this issue. Did any one solve this?
Could you please try remove your Xcode cache and npm cache as well?
If you are using react-link to link your dependencies: 1/ open your ios Podfile and delete all yout linked dependencies: pod 'xxxxxxx', :path => '../node_modules/xxxxx' 2/ Close Xcode 3/ In your /ios folder run "pod update" 4/ In your project source run "react-native link" 5/ Open Xcode and Clean Build Folder from Xcode Menu -> Product 6/ Run your application from Xcode 7/ Link manually the dependency "react-native-gesture-handler" into your Xcode Project following steps in documentation: https://facebook.github.io/react-native/docs/linking-libraries-ios 8/ Now run your application from Xcode, you should be fine.
@hichamnaimi We can't use this solution as Sentry runs a blocking command program when running react-native link
:/
@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 tried linking RNGestureHandler manually instead of using react-native link react-native-gesture-handler
did not work for me.
EDIT : Issue resolved, you also have to remove references added in the Podfile.lock. I thought manipulating Podfile.lock by hand would screw the podfile with the checksum.
@hichamnaimi at which point should we add back our pods?
@TomBerriot I have same Podfile.lock, how to resolved it?
I try all thing but still not resolved it please help me.
Have the same problem with RN 0.59.9
I faced the same issue and have been able to resolve it.
1) Right click your App project in XCode and select "Add files to
Now do a clean in XCode and Build the app. You should now also be able to launch the app using react-native run-ios.
Cheers!
I faced the same issue and have been able to resolve it.
- Right click your App project in XCode and select "Add files to ". Browse to the node_modules/react-native-gesture-handler/ios and Select RNGestureHandler.xcodeproj and click add
- Then Right click your RNGestureHandler.xcodeproj and select "Add files to RNGestureHander.xcodeproj" and browse to node_modules/react-native/React/ and select React.xcodeproj
Now do a clean in XCode and Build the app. You should now also be able to launch the app using react-native run-ios.
Cheers!
@shyam-unnithan Thanks, step 2 solved the issue!
Okay, here's my conundrum (I have installed all the latest versions of react-native and the herein defined dependencies). Firstly, I started from the top of this thread and worked my way down trying all suggestions and the result is, my Android works perfectly! However iOS doesn't.
I've followed the steps outlined by @shyam-unnithan, then:
react-native run-ios
I get the following error in the terminal:error React Native CLI uses auto linking for native dependencies, but the following modules are linked manually: - react-native-gesture-handler (to unlink run: "react-native unlink react-native-gesture-handler")
and the build fails:
'React/RCTEventDispatcher.h' file not found #import <React/RCTEventDispatcher.h>
react-native unlink react-native-gesture-handler
, I noticed that it removes what I did re; @shyam-unnithan in Xcode and if I then attempt to run react-native run-ios
again, I get the following in the iOS simulator:null is not an object (evaluating '_RNGestureHandlerModule.default.Direction')
@douglascavanaugh Have you added use_native_modules!
in your Podfile and run pod install
after?
No, but it was already there when I did run pod install
:
And here's the rest of the Podfile:
@osdnk yes plus deleting whole folder of Xcode/DerivedData and reboot my Macbook
I faced the same issue and have been able to resolve it.
- Right click your App project in XCode and select "Add files to ". Browse to the node_modules/react-native-gesture-handler/ios and Select RNGestureHandler.xcodeproj and click add
- Then Right click your RNGestureHandler.xcodeproj and select "Add files to RNGestureHander.xcodeproj" and browse to node_modules/react-native/React/ and select React.xcodeproj
Now do a clean in XCode and Build the app. You should now also be able to launch the app using react-native run-ios.
Cheers!
Hi, I have the same issue. Should I add RNGestureHandler.xcodeproj to Library Folder ?
@osdnk yes plus deleting whole folder of Xcode/DerivedData and reboot my Macbook
I faced the same issue and have been able to resolve it.
- Right click your App project in XCode and select "Add files to ". Browse to the node_modules/react-native-gesture-handler/ios and Select RNGestureHandler.xcodeproj and click add
- Then Right click your RNGestureHandler.xcodeproj and select "Add files to RNGestureHander.xcodeproj" and browse to node_modules/react-native/React/ and select React.xcodeproj
Now do a clean in XCode and Build the app. You should now also be able to launch the app using react-native run-ios. Cheers!
Hi, I have the same issue. Should I add RNGestureHandler.xcodeproj to Library Folder ?
Follow step 1.
I added #import <React/RCTEventDispatcher.h> in the same file and it works with lots of warning.
For me, I was able to do the following steps to get the build to succeed:
yarn upgrade
// This step is criticalcd ios
then pod install
None of the above works for me. I tried all forms of tricks here, but none of it works. Tried following:
I faced the same issue and have been able to resolve it.
- Right click your App project in XCode and select "Add files to ". Browse to the node_modules/react-native-gesture-handler/ios and Select RNGestureHandler.xcodeproj and click add
- Then Right click your RNGestureHandler.xcodeproj and select "Add files to RNGestureHander.xcodeproj" and browse to node_modules/react-native/React/ and select React.xcodeproj
Now do a clean in XCode and Build the app. You should now also be able to launch the app using react-native run-ios.
Cheers!
In my react-native/React there is no React. xcodeproj.
My react-native version: "react-native": "~0.63.4",
upgraded platform :ios, '11.0' to '12.0' in podfile having react-native 63.4 and "expo": "~41.0.1", can't Connect RNGestureHandler.xcodeproj & React.xcodeproj because n my react-native/React there is no React. xcodeproj.
How to resolve Error: React/RCTEventDispatcher.h not found in iOS
I am still getting this error on my M1 Macbook with React Native 0.66.
and "react-native-gesture-handler": "^1.10.3",
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
I am sad to report that this hasn't solved my problem. It worked a few times but not every time.
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
My issue was a tad different as my error occurred inside the react-native-view-pager
package. I was able to get passed this issue by running pod update
inside my ios directory. I also updated my cocoapods version to CocoaPods: 1.12.1
with sudo gem install cocoapods
but I don't think this was needed.
Following the instruction via:
Then I compiled my Xcode project and got an issue:
Error: React/RCTEventDispatcher.h not found
My environment is: "react": "16.3.2", "react-native": "0.55.3", "react-native-gesture-handler": "^1.0.0",
By the way, is there a pod that I can use for
Cocoapod
in iOS?