React error resolution for native configuration

Source: Internet
Author: User

1. If you succeed the success interface

According to the official tutorial to set up the rn-android environment, you can put the demo run up;

The local actual access address can refer to: http://localhost:8081/index.android.bundle?platform=android

2. It may fail for the first time 1. A red interface appears, failed JS bundle

Solution:

Sometimes you run react-native run-android and find that you cannot run the dev server automatically, you can start the server manually by running the following command in the current project directory:

    $ react-native Start

The 8081 port specified by the local server did not transfer data successfully

ADB reverse tcp:8081 tcp:8081

can be accessed in the Chrome browser: http://localhost:8081/

See the packets over the js-server.

If the system below 5.0 will burst closed, it is recommended to use WiFi mode for debugging

    $ adb Reverse tcp:8081 tcp:8081    error:closed  

Tap the phone's physical menu key, or shake the phone to appear in the Dev Settings menu (This operation is only valid if you have already opened the Reactnavtive app interface)

Dev Settings, Debug Server host for device,

To fill in the IP address on your PC, you need to connect to the TPLINK-WIFI-SID on the same network segment, such as your phone and PC.

After that Menu-reload JS can.

If the phone and the computer are not in the same network segment, or the phone can not access, there will be unable to download JS bundle of Red Screen interface

2. A white interface may appear

Solution:

such as MIUI system, the default will be the display of the hover window switch to shield off "user can manually switch", after operation, re-load can be

More common building problems can be referred to below: http://www.race604.com/react-native-for-android-start/

3.invariant violation:application Red Screen error

Solution:

1. First, you can refer to Overstack and an official issue:

Http://stackoverflow.com/questions/29287987/invariant-violation-application-awesomeproject-has-not-been-registered-when-b

https://github.com/facebook/react-native/issues/500#issuecomment-111575780

2. According to the specific error information to troubleshoot, and finally found that I was the cause of this error is accidentally hit the file header more invalid characters, resulting in the following line of code can not parse correctly. So just need to put that useless code "affect the grammar compile link" Delete, re-reload-js can

4. Load Uiexplorerblock failed

This is an official bug, the default node_modules does not have the component corresponding to the

https://github.com/facebook/react-devtools/issues/128

iOS has this problem before, and Android's initial version seems to have the same problem

5.. babelrc.stage File Errors
transforming [========================================] -% 399/ -Error  whilePersisting cache: Transformerror: /Users/Alexwan/Documents/Project/HelloWorld/Node_modules/React-Deep-Force-Update/Lib/Index.Js:[BABEL]/Users/Alexwan/Documents/Project/HelloWorld/Node_modules/React-Deep-Force-Update/Lib/Index.Js: UnknownOption:/Users/Alexwan/Documents/Project/HelloWorld/Node_modules/React-Deep-Force-Update/.Babelrc.Stage

Node_modules/react-deep-force-update/.babelrc.stage this file in the project folder will also cause it to be 红屏 deleted and run through.

React error resolution for native configuration

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.