Android React Native卡在启动画面

时间:2018-07-11 13:55:17

标签: android reactjs react-native react-redux react-native-navigation

有时候,在背景中呆了很长时间之后,我的应用无法加载并卡在启动屏幕上。

我能够通过以下方式在调试模式下重现此内容:
-启动应用程序
-远程使用调试js
-杀死应用程序
-启动应用程序

在发布模式下,作者:
-启动应用程序
-进入参数
-开发选项
-启用不保留活动
-再次启动应用程序

如果在调试模式下尝试使用release方法重现此错误,则会出现以下错误:

    Process: com.situaction, PID: 22308
    java.lang.RuntimeException: An error occurred while executing doInBackground()
        at android.os.AsyncTask$3.done(AsyncTask.java:318)
        at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
        at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
        at java.util.concurrent.FutureTask.run(FutureTask.java:242)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
     Caused by: java.lang.IllegalStateException: closed
        at okhttp3.internal.ws.RealWebSocket.close(RealWebSocket.java:164)
        at com.facebook.react.packagerconnection.ReconnectingWebSocket.closeWebSocketQuietly(ReconnectingWebSocket.java:110)
        at com.facebook.react.packagerconnection.ReconnectingWebSocket.closeQuietly(ReconnectingWebSocket.java:103)
        at com.facebook.react.packagerconnection.JSPackagerClient.close(JSPackagerClient.java:96)
        at com.facebook.react.devsupport.DevServerHelper$2.doInBackground(DevServerHelper.java:158)
        at com.facebook.react.devsupport.DevServerHelper$2.doInBackground(DevServerHelper.java:154)
        at android.os.AsyncTask$2.call(AsyncTask.java:304)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
        at java.lang.Thread.run(Thread.java:761)

它似乎与react-native-navigation和/或react-native-redux有关 所以这是我的依赖项:

"react": "16.0.0-alpha.6",
"react-native": "0.43.3",
"react-native-navigation": "1.1.398",
"react-redux": "^5.0.5",
"redux": "^3.7.0",
"redux-logger": "^3.0.1",
"redux-observable": "^0.14.1",
"redux-persist": "^4.8.1",
"redux-persist-transform-filter": "0.0.13",

1 个答案:

答案 0 :(得分:0)

好吧,如果发现这是一个反应式本机导航问题。
我通过降级到1.1.250版本解决了问题。

似乎无法解决问题,因为我无法再复制它,并且我的应用现在可以正常工作。