New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate interface definition for class 'RCTBridge' #11725

Closed
brunolemos opened this Issue Jan 4, 2017 · 14 comments

Comments

Projects
None yet
@brunolemos
Contributor

brunolemos commented Jan 4, 2017

Description

Can't build project after upgrading to 0.40.

PS1: Upgraded from 0.39 using react-native-git-upgrade.
PS2: I compared the diff with this 0.39..0.40 diff and they are identical, so the upgrade went fine.

Additional Information

  • React Native version: 0.40
  • Platform: iOS
  • Operating System: macOS 10.12.13

Screenshot

screenshot

@DesignMonkey

This comment has been minimized.

DesignMonkey commented Jan 4, 2017

Same happens with new installation with all the RN packages imported with react-native link

@brunolemos

This comment has been minimized.

Contributor

brunolemos commented Jan 5, 2017

This was probably introduced by the breaking change on 0.40 that requires a "React/" namespace on header paths. Apparently all native modules will have to upgrade themselves to support RN >= 0.40, so... we better send them PRs!

@justinmoon

This comment has been minimized.

justinmoon commented Jan 5, 2017

I was just starting a project from scratch.

It would run after running react-native init, but as soon as I followed these instructions to include native code for the react-native-webrtc module, I started getting this error.

Hopefully that helps ...

@ericvicenti

This comment has been minimized.

Contributor

ericvicenti commented Jan 5, 2017

Yeah it seems that react-native-webrct hasn't upgraded for v0.40 yet. Sorry about the inconvenience

See here: https://github.com/oney/react-native-webrtc/search?utf8=%E2%9C%93&q=import+%22

A bunch of these need to be converted. If it says #import "RCTConvert.h", it needs to change to #import <React/RCTConvert.h>

@xuechinahb

This comment has been minimized.

xuechinahb commented Jan 6, 2017

same problem to me!

@Amurmurmur

This comment has been minimized.

Amurmurmur commented Jan 6, 2017

Problem with react-native-fbsdk and Facebook iOS SDK, its the same :(

@SMJ93

This comment has been minimized.

SMJ93 commented Jan 8, 2017

I tried what @ericvicenti said above and changed all #import "RCTConvert.h" to #import <React/RCTConvert.h>, but I am still getting the error:
/node_modules/react-native/React/Base/RCTBridge.h:65:1: Duplicate interface definition for class 'RCTBridge'
This is for https://github.com/wix/react-native-navigation.

@nihgwu

This comment has been minimized.

Contributor

nihgwu commented Jan 8, 2017

@SMJ93 remove all the React Native related Header Search Paths in 3rd party libraries

@SMJ93

This comment has been minimized.

SMJ93 commented Jan 8, 2017

Finally!! I managed to fix the error by Find and Replace in Project and change all #import "RCTBridge.h" to #import <React/RCTBridge.h> in addition to @ericvicenti's and @nihgwu answer's above. Thanks guys.

@christiangenco

This comment has been minimized.

christiangenco commented Jan 10, 2017

I got it working by upgrading to the most recent github version of react-native-fbsdk. The official release should be out in the next few days.

@georgiana-gligor

This comment has been minimized.

georgiana-gligor commented Jan 26, 2017

A lot of the 3rd party libraries have yet to release stable versions with RN 0.40 fix, and it can get frustrating very quickly. We confronted with this problem as well, on several packages. I described our approach and am leaving the link here so that others can use it to continue working asap.

@franj0

This comment has been minimized.

franj0 commented Apr 6, 2017

For me fix was:
react-native upgrade

hit y for all iOS files

@r01010010

This comment has been minimized.

r01010010 commented May 16, 2017

@nihgwu 'remove all the React Native related Header Search Paths in 3rd party libraries' how to do that?

@zhuozp

This comment has been minimized.

zhuozp commented Sep 7, 2017

@nihgwu @brunolemos the same problem happened for react native 0.43.4. It should be solved with correct process neither to change all #import "RCTBridge.h" to #import <React/RCTBridge.h>. This solution is pretty bad。So. hope for all your Answer. THX.

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.