Got JS Exception: ReferenceError: Can't find varia

           在Android Studio上首次運行(react-native)AwesomeProject(導入android便可),出現了一下問題java

                                      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

解決方案:android

在命令提示框的工程目錄下 react-native start(打開服務器,保持開的狀態),shell

如果服務器已打開則輸入react-native run-androidreact-native

而後cmd中adb shell input keyevent 82服務器

虛擬機會出現,選擇Reload JS 便可更新修改後的狀態,不須要從新run。oop

這只是這次問題的解決方法。spa

相關文章
相關標籤/搜索