facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 908 forks source link

React Native 0.60, No visible @interface for 'RCTEventDispatcher' declares the selector #586

Open erdemildiz opened 5 years ago

erdemildiz commented 5 years ago

I upgrade RN version to 0.59 to 0.60 and I am getting below error on Xcode build.

RCTFBSDK/login/RCTFBSDKLoginButtonManager.m:71:32: No visible @interface for 'RCTEventDispatcher' declares the selector 'sendInputEventWithName:body:'

Screen Shot 2019-07-04 at 15 34 02
thomasvm commented 5 years ago

This is caused by this commit in react-native. Apparently sendInputWithEventName was a deprecated method, and was removed on 0.60.0

pratt3351 commented 5 years ago

same problem!

danfri86 commented 5 years ago

This issue seems to have been open for a while, but not fixed yet: https://github.com/facebook/react-native-fbsdk/issues/479

zunsakai commented 5 years ago

same issue !

Mai-Hong-Son commented 5 years ago

same issue!

andrewdazs commented 5 years ago

Same issue here. Does anyone know if sendInputWithEventName was changed by another method or something?

thomasvm commented 5 years ago

The master branch of this repository already contains the updated code

https://github.com/facebook/react-native-fbsdk/blob/master/ios/RCTFBSDK/login/RCTFBSDKLoginButtonManager.m#L60-L88

g33ktony commented 5 years ago

The master branch of this repository already contains the updated code

https://github.com/facebook/react-native-fbsdk/blob/master/ios/RCTFBSDK/login/RCTFBSDKLoginButtonManager.m#L60-L88

How do I download this patch?

concuacon commented 5 years ago

The master branch of this repository already contains the updated code https://github.com/facebook/react-native-fbsdk/blob/master/ios/RCTFBSDK/login/RCTFBSDKLoginButtonManager.m#L60-L88

How do I download this patch?

You can run yarn add git+https://github.com/facebook/react-native-fbsdk.git Hope this can help you.

danfri86 commented 5 years ago

I can confirm that using master branch works. Thanks @concuacon !

lawrencehui commented 5 years ago

Hi @danfri86, I updated to the latest master and then I start to get header errors that 'React/RCTBridgeModule.h' file not found under RCTFBSDK, any idea how could solve this?

danfri86 commented 5 years ago

@lawrencehui The steps I did to get it running was:

That's all I needed if I remember correct. Hope it works for you as well. If you're building the project in xcode make sure to open .xcworkspace and not .xcodeproj as noted in the blog post from the release of react-native 0.60.0.

panvourtsis commented 5 years ago

after trying from project root i am facing other error

'React/RCTComponentEvent.h' file not found

using React Native 0.60.0. I also tried 0.60.3 as well.

Anyone has this as well after trying @danfri86 suggestion ?

lawrencehui commented 5 years ago

after trying from project root i am facing other error

'React/RCTComponentEvent.h' file not found

using React Native 0.60.0. I also tried 0.60.3 as well.

Anyone has this as well after trying @danfri86 suggestion ?

ya I have actually spent like two nights to figure out the steps that @danfri86 suggested and confirmed it works.

for react-native-fbsdk, make sure you are using the latest branch (1.00-rc5)

panvourtsis commented 5 years ago

after trying from project root i am facing other error 'React/RCTComponentEvent.h' file not found using React Native 0.60.0. I also tried 0.60.3 as well. Anyone has this as well after trying @danfri86 suggestion ?

ya I have actually spent like two nights to figure out the steps that @danfri86 suggested and confirmed it works.

for react-native-fbsdk, make sure you are using the latest branch (1.00-rc5)

Yeah i tried that as well, I also tried older rc versions to see if the latest was giving me the error.

Both rc versions and @danfri86 suggestion give me the same error

React/RCTComponentEvent.h' file not found

lawrencehui commented 5 years ago

after trying from project root i am facing other error 'React/RCTComponentEvent.h' file not found using React Native 0.60.0. I also tried 0.60.3 as well. Anyone has this as well after trying @danfri86 suggestion ?

ya I have actually spent like two nights to figure out the steps that @danfri86 suggested and confirmed it works. for react-native-fbsdk, make sure you are using the latest branch (1.00-rc5)

Yeah i tried that as well, I also tried older rc versions to see if the latest was giving me the error.

Both rc versions and @danfri86 suggestion give me the same error

React/RCTComponentEvent.h' file not found

I also encountered this error before, have you also check inside Build Phases, there are no other items under Link Binary With Libraries except libPods-xxxxx.a (xxxx is your app name)

Vitalik7 commented 5 years ago

same issue!

amie-wilt commented 5 years ago

after trying from project root i am facing other error 'React/RCTComponentEvent.h' file not found using React Native 0.60.0. I also tried 0.60.3 as well. Anyone has this as well after trying @danfri86 suggestion ?

ya I have actually spent like two nights to figure out the steps that @danfri86 suggested and confirmed it works. for react-native-fbsdk, make sure you are using the latest branch (1.00-rc5)

Yeah i tried that as well, I also tried older rc versions to see if the latest was giving me the error.

Both rc versions and @danfri86 suggestion give me the same error

React/RCTComponentEvent.h' file not found

I also encountered this error before, have you also check inside Build Phases, there are no other items under Link Binary With Libraries except libPods-xxxxx.a (xxxx is your app name)

I'm seeing React/RCTComponentEvent.h' file not found as well.

@lawrencehui What do you mean by making sure there are no other items under Link Binary With Libraries? I have various frameworks and a libRCTPushNotification.a file in there. Is that not okay?

React Native: 0.60.3 react-native-fbsdk: 1.0.0-rc.5 Facebook SDK: 5.2.1 Xcode: 10.2.1 node: 12.5.0

lawrencehui commented 5 years ago

I'm seeing React/RCTComponentEvent.h' file not found as well.

@lawrencehui What do you mean by making sure there are no other items under Link Binary With Libraries? I have various frameworks and a libRCTPushNotification.a file in there. Is that not okay?

React Native: 0.60.3 react-native-fbsdk: 1.0.0-rc.5 Facebook SDK: 5.2.1 Xcode: 10.2.1 node: 12.5.0

I have not used the libRCTPushNotification library before, but since React 0.60.0^ supports automatic linking, you should now no need to use the link command in order to link your library. All additional libraries should be installed through Pods.

and under Link Binary With Libraries should only see libPods-[yourappname].a only.

IShotTheSheriff commented 5 years ago

For me it was the same issue that I described here. In short it was autolinking that was added in RN 0.60.0 and requires you to manually unlink any dependencies that you previously had:

npx react-native unlink react-native-fbsdk
cd ios
pod install
amie-wilt commented 5 years ago

Mine was as @lawrencehui suggested--I had to remove my libRCTPushNotification.a from Link Binary with Libraries and add it to my podfile. Maybe this was obvious but I didn't know to link local React libraries in my podfile:

pod 'React-RCTPushNotification', :path => '../node_modules/react-native/Libraries/PushNotificationIOS'

harzkr commented 5 years ago

Thank you @danfri86, your specified method is what's currently working correctly with react-native 0.60.3

dinithminura commented 5 years ago

@danfri86 's method worked for me, Thanks! I think yarn add git+https://github.com/facebook/react-native-fbsdk.git did the magic for me 😀

AurangzaibRamzan commented 5 years ago

check this out . you need to unlink the fbsdk as react native 0.60 offers autolink.

gluix20 commented 5 years ago

I was receiving the same error, after upgrading react-native from 0.59.8 to 0.60.5 After updating react-native-fbsdk in package.json from 0.10.1 to 1.0.3, a npm install & pod install later, the error is gone.

During the process I cleaned deriveddata folder in XCode.

maximevaly commented 4 years ago

HI! I currently have the same issue using "react-native": "0.60.5" and "react-native-fbsdk": "1.0.4".

None of the proposed solutions worked, but oddly enough if I download manually an archive from GItHub (either 1.0.3, 1.0.4 or master) and drop it in the node_modules/react-native-fbsdk/directory, it works.

So my current workaround is to run this command from my project's root folder whenever I change anything in its dependencies:

curl -sSL https://github.com/facebook/react-native-fbsdk/archive/master.zip  > /tmp/rnfbsdk-master.zip && \
unzip -q /tmp/rnfbsdk-master.zip && \
rm -fr /tmp/rnfbsdk-master.zip ./node_modules/react-native-fbsdk && \
mv ./react-native-fbsdk-master ./node_modules/react-native-fbsdk

HTH

hb2708 commented 4 years ago

@janicduplessis @dzhuowen Looks like many people facing this any plan to release on NPM Also?

nicholaslee119 commented 4 years ago

Just as https://github.com/facebook/react-native/commit/41343f6a7305cc82c412898139c46c01047f3399#diff-eee95b3297ff73b389d2eab419631d6dL88

__deprecated_msg("Use RCTDirectEventBlock or RCTBubblingEventBlock instead");

said, I think it is better to use RCTDirectEventBlock or RCTBubblingEventBlock instead to fix this bug

and, as a reference, this issue discussed how to do with that

https://github.com/facebook/react-native/issues/8714