我要在现有的本机Android应用程序中添加一些React Native视图。
当我显示一个视图时,它工作正常。在我导航到另一个视图并返回后,第一个视图不会崩溃,但会损坏,即:不可单击,轮播可滚动,但行为奇怪(未捕捉到特定组件)。
我在日志中看到可疑的警告,但是在再次显示视图时不会显示警告,而是稍后-在尝试触摸/交互时:
10-16 11:38:59.890 9618-9618/com.someapp.android W/unknown:ReactNative: Unable to dispatch touch to JS as the catalyst instance has not been attached
10-16 11:38:59.891 9618-9618/com.someapp.android W/unknown:ReactNative: Unable to dispatch touch to JS as the catalyst instance has not been attached
10-16 11:38:59.892 9618-9618/com.someapp.android W/unknown:ReactNative: Tried to enqueue runnable on already finished thread: 'js... dropping Runnable.
10-16 11:38:59.906 9618-9618/com.someapp.android W/MessageQueue: Handler (com.facebook.react.bridge.queue.MessageQueueThreadHandler) {edf0718} sending message to a Handler on a dead thread
java.lang.IllegalStateException: Handler (com.facebook.react.bridge.queue.MessageQueueThreadHandler) {edf0718} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543)
at android.os.Handler.enqueueMessage(Handler.java:643)
at android.os.Handler.sendMessageAtTime(Handler.java:612)
at android.os.Handler.sendMessageDelayed(Handler.java:582)
at android.os.Handler.post(Handler.java:338)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl.runOnQueue(MessageQueueThreadImpl.java:59)
at com.facebook.react.bridge.ReactContext.runOnJSQueueThread(ReactContext.java:297)
at com.facebook.react.uimanager.events.EventDispatcher$ScheduleDispatchFrameCallback.doFrame(EventDispatcher.java:285)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:134)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:105)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:925)
at android.view.Choreographer.doCallbacks(Choreographer.java:702)
at android.view.Choreographer.doFrame(Choreographer.java:635)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
10-16 11:38:59.907 9618-9618/com.someapp.android W/unknown:ReactNative: Unable to dispatch touch to JS as the catalyst instance has not been attached
10-16 11:38:59.929 9618-9618/com.someapp.android W/unknown:ReactNative: Unable to dispatch touch to JS as the catalyst instance has not been attached
10-16 11:38:59.940 9618-9618/com.someapp.android W/unknown:ReactNative: Unable to dispatch touch to JS as the catalyst instance has not been attached
视图以带有react-native-android-fragment(v1.0.0)的片段实现
有人有类似的问题吗?关于如何追踪此消息的任何建议?
答案 0 :(得分:0)
实际上,react-native-android-fragment及其用法似乎是一个问题。
场景:
这会产生警告:
10-16 11:38:59.891 9618-9618/com.someapp.android W/unknown:ReactNative: Unable to dispatch touch to JS as the catalyst instance has not been attached
10-16 11:38:59.892 9618-9618/com.someapp.android W/unknown:ReactNative: Tried to enqueue runnable on already finished thread: 'js... dropping Runnable.
10-16 11:38:59.906 9618-9618/com.someapp.android W/MessageQueue: Handler (com.facebook.react.bridge.queue.MessageQueueThreadHandler) {edf0718} sending message to a Handler on a dead thread
java.lang.IllegalStateException: Handler (com.facebook.react.bridge.queue.MessageQueueThreadHandler) {edf0718} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543)
...
此处发布的问题:https://github.com/hudl/react-native-android-fragment/issues/18