alinz / react-native-webview-bridge

React Native Webview with Javascript Bridge
MIT License
1.37k stars 493 forks source link

Duplicate interface definition for class RCTViewManager #236

Open vvavepacket opened 7 years ago

vvavepacket commented 7 years ago

Help guys, this is my first time doing Xcode stuff. Ive been successful in Android, but having this issues on iOS for hours. Can anyone shed me some light on how to solve this error?

Thank you.

image

jmuchaxo commented 7 years ago

I am facing the same issue, also starting with iOS, I did this: sudo npm install -g react-native-cli npm install ./link.sh react-native link react-native run-ios compiling on Xcode I get the same problem

jmuchaxo commented 7 years ago

I looked up the error on google and found this bug is similar to https://github.com/shoutem/ui/issues/134 so I changed the includes mentioned in the above link to use prefix React/

RCTWebViewBridge.h:

import "React/RCTView.h"

RCTWebViewBridge.m:

import "React/RCTAutoInsetsProtocol.h"

import "React/RCTConvert.h"

import "React/RCTEventDispatcher.h"

import "React/RCTLog.h"

import "React/RCTUtils.h"

import "React/RCTView.h"

import "React/UIView+React.h"

RCTWebViewBridgeManager.h

import "React/RCTViewManager.h"

RCTWebViewBridgeManager.m

import "RCTWebViewBridgeManager.h"

import "React/RCTBridge.h"

import "React/RCTUIManager.h"

import "RCTWebViewBridge.h"

import "React/UIView+React.h"

and the error is gone

andcosta commented 6 years ago

same issue

edison0951 commented 6 years ago

because of the new version of react native has change to framework, so the RCTWebViewBridge.h can't found. You must add "React" or prefix to head file.

murrayee commented 6 years ago

thanks ,it work

lichenghai commented 6 years ago

Thanks to jmuchaxo, it works fine!

jeanniton-mnr commented 5 years ago

Thanks @jmuchaxo

jeanniton-mnr commented 5 years ago

And for those who are new to Xcode, to find & edit these source files, navigate to [your project name] > Libraries > React-Native-Webview-Bridge.xcodeproj > React-Native-Webview-Bridge in the left navigation pane of Xcode.

raman-sidhu commented 4 years ago

Thanks @jmuchaxo, it's working