You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I embed two ReactFragment into ViewPager of a Activity, each ReactFragment loads a different bundle file at the same time. Then we have come across a random crash as the log below, probability is about 60-70%. According to the information, it seems that ReactNative has some problem on dealing with multi ReactFragment loaded at the same time in a same Activity.
The bundle file works well with ReactActivity or single ReactFragment.
Exception log
04-02 16:51:52.102 8996-10354/? E/unknown:ViewManager: Error while updating prop left
java.lang.IllegalArgumentException: method com.facebook.react.uimanager.LayoutShadowNode.setPositionValues argument 1 has type int, got null
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:104)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:148)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:52)
at com.facebook.react.uimanager.ReactShadowNode.updateProperties(ReactShadowNode.java:258)
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:184)
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:235)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:319)
at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:743)
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:150)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
at java.lang.Thread.run(Thread.java:833)
others, for example:
04-02 17:03:59.075 8996-10826/? E/unknown:ViewManager: Error while updating prop marginRight
...
04-02 17:05:08.362 8996-11119/? E/unknown:ViewManager: Error while updating prop position
...
04-02 17:06:07.946 8996-11424/? E/unknown:ViewManager: Error while updating prop height
...
04-02 17:07:24.751 8996-11885/? E/unknown:ViewManager: Error while updating prop bottom
...
04-02 17:10:18.569 8996-12535/? E/unknown:ViewManager: Error while updating prop flexDirection
...
04-02 17:13:05.374 8996-13067/? E/unknown:ViewManager: Error while updating prop right
...
or other random props.
Solution
I did't find a very correct solution. However, I found that when the exception caught by NativeModuleCallExceptionHandler I through invoke the XReactInstanceManagerImpl::recreateReactContextInBackgroundFromBundleLoader to reload the bundle file, in this way it can be normal rendering again.
I expect to find a real solution. Thanks!
Additional Information
React Native version: 0.41.0
Platform: Android
Development Operating System: MacOS
Dev tools: Android Studio 2.2, Android SDK 16+
The text was updated successfully, but these errors were encountered:
Description
I embed two
ReactFragment
intoViewPager
of aActivity
, eachReactFragment
loads a different bundle file at the same time. Then we have come across a random crash as the log below, probability is about 60-70%. According to the information, it seems that ReactNative has some problem on dealing with multiReactFragment
loaded at the same time in a sameActivity
.The bundle file works well with
ReactActivity
or singleReactFragment
.Exception log
others, for example:
or other random props.
Solution
I did't find a very correct solution. However, I found that when the exception caught by
NativeModuleCallExceptionHandler
I through invoke theXReactInstanceManagerImpl::recreateReactContextInBackgroundFromBundleLoader
to reload the bundle file, in this way it can be normal rendering again.I expect to find a real solution. Thanks!
Additional Information
The text was updated successfully, but these errors were encountered: