ReferenceError: Can't find variable: __fbBatchedBridge

后端 未结 8 2006
花落未央
花落未央 2021-02-05 00:55

Using just the default code from react-native init AwesomeProject, when I run the app I get the \'ReferenceError: Can\'t find variable: __fbBatchedBridge (line 1 in

8条回答
  •  情歌与酒
    2021-02-05 01:12

    Thank you rmevans9 and Anonsage for your answers!

    I am using HTC One on Ubuntu and there is no menu option, anyway this is the summary of the answers that worked for me:

    1. Create the project $ react-native init MyProject $ cd MyProject/

    2. In first console tab run and leave it running as you develop (react-native start alternative): $ npm start

    3. In second console tab compile and install the project (connect the device to the USB if you want): $ react-native run-android

    4. Fix ReferenceError: Can't find variable: __fbBatchedBridge:

      • Find you local ip address by executing ifconfig on Linux/Mac, for example: inet addr:192.168.0.3
      • Shake the device to see menu options while app is running (if you don't have "Menu" button)
      • Go to Dev Settings -> Debug server host & port for device in Debugging section and copy your local ip address with the specific port: 192.168.0.3:8081 (the port can be viewed when running npm start from the first tab) then go/press Back
      • Shake the device to see menu options again and press Enable Live Reload (to see changes live when editing)
      • Shake the device to see menu options again and press Reload JS

提交回复
热议问题