Got JS Exception: ReferenceError: Can't find varia

           在Android Studio上首次运行(react-native)AwesomeProject(导入android即可),出现了一下问题

                                      Got JS Exception: ReferenceError: Can't find variable: __fbBatchedBridge
01-27 03:24:54.181 3373-3467/com.awesomeproject E/unknown:React: Exception in native call from JS
01-27 03:24:54.181 3373-3467/com.awesomeproject E/unknown:React: com.facebook.react.bridge.JSExecutionException: ReferenceError: Can't find variable: __fbBatchedBridge (line 1 in the generated bundle)
01-27 03:24:54.181 3373-3467/com.awesomeproject E/unknown:React:     at com.facebook.react.bridge.ReactBridge.callFunction(Native Method)
01-27 03:24:54.181 3373-3467/com.awesomeproject E/unknown:React:     at com.facebook.react.bridge.CatalystInstanceImpl$3.run(CatalystInstanceImpl.java:203)
01-27 03:24:54.181 3373-3467/com.awesomeproject E/unknown:React:     at android.os.Handler.handleCallback(Handler.java:733)
01-27 03:24:54.181 3373-3467/com.awesomeproject E/unknown:React:     at android.os.Handler.dispatchMessage(Handler.java:95)
01-27 03:24:54.181 3373-3467/com.awesomeproject E/unknown:React:     at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
01-27 03:24:54.181 3373-3467/com.awesomeproject E/unknown:React:     at android.os.Looper.loop(Looper.java:136)
01-27 03:24:54.181 3373-3467/com.awesomeproject E/unknown:React:     at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:184)
01-27 03:24:54.181 3373-3467/com.awesomeproject E/unknown:React:     at java.lang.Thread.run(Thread.java:841)

解决方案:

在命令提示框的工程目录下 react-native start(打开服务器,保持开的状态),

若是服务器已打开则输入react-native run-android

然后cmd中adb shell input keyevent 82

虚拟机会出现Got JS Exception: ReferenceError: Can't find varia_第1张图片,选择Reload JS 即可更新修改后的状态,不需要重新run。

这只是此次问题的解决方法。

你可能感兴趣的:(js,exception,androidstudio,react-native)