zq010
zq010

Reputation: 175

'Debug in Chrome' not work in react native for android

When I open the official demo in emulator64-x86, it load successfully, and then I press 'F2', and click 'Debug in Chrome' in the pop up, my chrome browser open 'http://localhost:8081/debugger-ui' automatically, but it doesn't load my project as the emulator. I get some warnings in the console as below:

Warning: Native component for "RCTModalHostView" does not exist
Warning: Native component for "RCTTextView" does not exist
Warning: Native component for "RCTTextField" does not exist
Running application "AwesomeProject" with appParams: {"initialProps":{},"rootTag":1}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
Unknown method: undefined

Does anyone have these problems? How to solve it? Thanks in advance.

Upvotes: 2

Views: 2152

Answers (2)

Sabash
Sabash

Reputation: 152

Open file react-native/Libraries/Modal/Modal.js

replace the following line

var RCTModalHostView = requireNativeComponent('RCTModalHostView', null);

with

var Platform = require('Platform'); if (Platform.OS === 'ios') { var RCTModalHostView = requireNativeComponent('RCTModalHostView', null); }

Modal only support in ios. so we need to apply the if condition

Upvotes: 5

Tjorriemorrie
Tjorriemorrie

Reputation: 17282

Those warnings are fixed in the coming version 0.12-RC By getting the logs the debugging is working; the reason why your app isn't loading will be a different issue.

Upvotes: 1

Related Questions