Skip to content
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

TyperError: Cannot read property 'NavigationType' of undefined #223

Open
znafets opened this issue Apr 5, 2017 · 12 comments
Open

TyperError: Cannot read property 'NavigationType' of undefined #223

znafets opened this issue Apr 5, 2017 · 12 comments

Comments

@znafets
Copy link

znafets commented Apr 5, 2017

Hi,
I trying to use this bridge in my project, but fail to understand why I get the error above ...
Assuming this lib should work as is. So why does it not? ... unless this project is not maintained anymore?

I am using the latest stable version of react-native

@feixue1232
Copy link

I also have the problem, who can help me to reslove it ? thanks

@gerow-x
Copy link

gerow-x commented Apr 17, 2017

@znafets @feixue1232 run a command such as the following:
$ react-native link

@rolandfromrobin
Copy link

rolandfromrobin commented May 16, 2017

I'm running into the same issue :/
@471685249 I tried setting up a new project to verify this, linked the library, got the following result:

rnpm-install info Linking react-native-webview-bridge android dependency
rnpm-install info Android module react-native-webview-bridge has been successfully linked
rnpm-install info Linking react-native-webview-bridge ios dependency
rnpm-install info iOS module react-native-webview-bridge has been successfully linked

However, when I run the code, I still get the same error.
Whenever I compile, I get about 32 of these errors complaining about duplicate declarations in the webview-bridge module:

In file included from /Users/.../Documents/Projects/.../node_modules/react-native-webview-bridge/ios/RCTWebViewBridgeManager.m:15: ../../../node_modules/react-native/React/Base/RCTBridge.h:176:53: error: property has a previous declaration @property (nonatomic, copy, readonly) NSDictionary *launchOptions;

Any thoughts? Cheers!

@ruridge
Copy link

ruridge commented Jun 7, 2017

I'm stuck with the same error: Cannot read property 'NavigationType' of undefined
I've run react-native link successfully which now gives the following output:

rnpm-install info iOS module react-native-touch-id is already linked
rnpm-install info Android module react-native-vector-icons is already linked
rnpm-install info iOS module react-native-vector-icons is already linked
rnpm-install info Android module react-native-webview-bridge is already linked
rnpm-install info iOS module react-native-webview-bridge is already linked
rnpm-install info Linking assets to ios project
rnpm-install info Linking assets to android project
rnpm-install info Assets have been successfully linked to your project

react 16.0.0-alpha.6
react-native 0.44.0
react-native-webview-bridge 0.33.0

@QQizi
Copy link

QQizi commented Jun 11, 2017

Same here, screen of the error
react-native link have been successfully done

@vagnerSl
Copy link

vagnerSl commented Jul 3, 2017

=(

@trops
Copy link

trops commented Aug 21, 2017

agreed, getting the NaviationType undefined error as well.

@rolandfromrobin
Copy link

rolandfromrobin commented Aug 22, 2017

I was able to link the module by calling react-native link after installing.
Make sure your link succeeded by checking (in XCode) that your project has the following library under the Libraries folder: React-Native-Webview-Bridge.xcodeproj. If not, add it.
Then, click on your project, go to the General tab, and scroll down to Linked Frameworks and Libraries. Make sure libReact-Native-Webview-Bridge.a is on the list. If it isn't, add it using the + sign.
After the link is successful, you'll still get a bunch of duplicate definition errors in iOS when trying to run from XCode (i listed it above). It looks like the project is importing some libraries that react-native is already importing, resulting in a conflict. I was able to fix these by using the following steps:

Open XCode, and make the following amendments:

  1. remove #import <React/RCTView.h> from RCTView.h
  2. change #import "RCTBridge.h" to #import "React/RCTBridge.h" in RCTWebViewBridgeManager.m
  3. change #import <React/RCTViewManager.h> to #import "RCTViewManager.h" in RCTUIManager.h
  4. change #import "RCTLog.h" to #import "React/RCTLog.h" in RCTWebViewBridge.m

I was able to run the project successfully afterwards. Hope that helps.

@david-olaf
Copy link

It works for me. Thanks

@facuescobar
Copy link

Thanks! that worked to me too!

@thyzzv
Copy link

thyzzv commented Oct 13, 2017

Just use the latest from master also does the trick:
react-native-webview-bridge "git://github.com/alinz/react-native-webview-bridge.git#master"

@suwu150
Copy link

suwu150 commented Aug 1, 2018

i meet it.i react-native link , But it doesn't work

  Node: 8.3.0
  Yarn: Not Found
  npm: 5.3.0
  Watchman: Not Found
  Xcode: Xcode 9.3.1 Build version 9E501
  Android Studio: 3.1 AI-173.4819257

Packages: (wanted => installed)
  react: 16.0.0 => 16.0.0
  react-native: 0.51.0 => 0.51.0


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests