非默认端口上的端口打包程序和调试 - 异常引发

时间:2017-05-12 07:45:42

标签: react-native react-native-android

我在非默认端口上运行打包程序,因为打包程序的默认值由McAfee使用命令占用:

react-native start --port 8083

我通过

运行app
react-native run-android

和反向代理

adb -s emulator-5554 reverse tcp:8083 tcp:8083

应用程序没有问题,但是当我想要调试时,我得到了异常:

    Exception in native call
 com.facebook.react.bridge.JavaJSExecutor$ProxyExecutorException: com.facebook.react.common.JavascriptException: {"stack":"Error: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false' failed to load.\n    at executeApplicationScript (http://localhost:8083/debuggerWorker.js:40:9)\n    at http://localhost:8083/debuggerWorker.js:65:7"}
     at com.facebook.react.devsupport.WebsocketJavaScriptExecutor.loadApplicationScript(WebsocketJavaScriptExecutor.java:173)
     at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
     at android.os.Handler.handleCallback(Handler.java:739)
     at android.os.Handler.dispatchMessage(Handler.java:95)
     at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
     at android.os.Looper.loop(Looper.java:148)
     at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:208)
     at java.lang.Thread.run(Thread.java:818)
  Caused by: com.facebook.react.common.JavascriptException: {"stack":"Error: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false' failed to load.\n    at executeApplicationScript (http://localhost:8083/debuggerWorker.js:40:9)\n    at http://localhost:8083/debuggerWorker.js:65:7"}
     at com.facebook.react.devsupport.JSDebuggerWebSocketClient.onMessage(JSDebuggerWebSocketClient.java:209)
     at okhttp3.internal.ws.RealWebSocket$1.onMessage(RealWebSocket.java:62)
     at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.java:242)
     at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:108)
     at okhttp3.internal.ws.RealWebSocket.readMessage(RealWebSocket.java:97)
     at okhttp3.ws.WebSocketCall.createWebSocket(WebSocketCall.java:152)
     at okhttp3.ws.WebSocketCall.access$000(WebSocketCall.java:41)
     at okhttp3.ws.WebSocketCall$1.onResponse(WebSocketCall.java:97)
     at okhttp3.RealCall$AsyncCall.execute(RealCall.java:126)
     at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
     at java.lang.Thread.run(Thread.java:818) 

调试器以某种方式将我的设置与默认设置混合。

如何设置项目以使调试工作?

0 个答案:

没有答案