Catalyst Instance has already disappeared: requested by Timing
java.lang.RuntimeException: Catalyst Instance has already disappeared: requested by Timing
at com.facebook.react.bridge.ReactContextBaseJavaModule.getReactApplicationContextIfActiveOrWarn(ReactContextBaseJavaModule.java:67)
at com.facebook.react.modules.core.TimingModule.access$000(TimingModule.java:22)
at com.facebook.react.modules.core.TimingModule$BridgeTimerManager.callTimers(TimingModule.java:28)
at com.facebook.react.modules.core.JavaTimerManager.createAndMaybeCallTimer(JavaTimerManager.java:341)
at com.facebook.react.modules.core.TimingModule.createTimer(TimingModule.java:91)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:223)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:923)
java.lang.RuntimeException: Catalyst Instance has already disappeared: requested by WebSocketModule
at com.facebook.react.bridge.ReactContextBaseJavaModule.getReactApplicationContextIfActiveOrWarn(ReactContextBaseJavaModule.java:67)
at com.facebook.react.modules.websocket.WebSocketModule.sendEvent(WebSocketModule.java:62)
at com.facebook.react.modules.websocket.WebSocketModule.notifyWebSocketFailed(WebSocketModule.java:340)
at com.facebook.react.modules.websocket.WebSocketModule.access$200(WebSocketModule.java:40)
at com.facebook.react.modules.websocket.WebSocketModule$1.onFailure(WebSocketModule.java:175)
at okhttp3.internal.ws.RealWebSocket.failWebSocket(RealWebSocket.java:570)
at okhttp3.internal.ws.RealWebSocket$1.onFailure(RealWebSocket.java:216)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:180)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
错误日志 在网上找了各种回复都没有一个具体的答案 导致的问题是 多次进入rn面板然后实例未销毁的内存卸载白屏返回原生的页面
具体的方式是因为在安卓提供的module中存在问题
原生module extends ReactContextBaseJavaModule implements LifecycleEventListener,
重写以下四个个方法
@Override
public void onHostResume() {
//尽量不要在这里进行监听操作 即使添加了 需要在下面的方法中销毁 不然会报错
register failed , the sensor listeners size has exceeded the maximum limit 128
之前在这里注册了遇到了这个问题 没有及时销毁导致报错
}
@Override
public void onHostPause() {
}
@Override
public void onHostDestroy() {
}
//必须重写销毁实例
@Override
public void onCatalystInstanceDestroy() {
super.onCatalystInstanceDestroy();
}
这样就可以避免白屏的问题了