React Native Navigation致命异常:尝试在视图被销毁后创建视图

时间:2019-03-08 10:34:46

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

问题说明::

我正在研究React本机应用程序,并使用React Native Navigation进行路由,GitHub link

有时我的应用在Android上崩溃,因为我安装了crashlytics,因此我使用Firebase崩溃日志验证了崩溃。我在crashlytics内部收到此错误日志::

  

致命异常:java.lang.RuntimeException:试图创建视图   在它已经被摧毁之后          在com.reactnativenavigation.viewcontrollers.ViewController.getView(ViewController.java:161)          在com.reactnativenavigation.viewcontrollers.ParentController.getView(ParentController.java:60)          在com.reactnativenavigation.viewcontrollers.stack.StackController.lambda $ push $ 4(StackController.java:172)          在com.reactnativenavigation.viewcontrollers.stack。-$$ Lambda $ StackController $ 06hFigyLWXXMellTVVP0d0y7blk.run(未知   资料来源:8)          在com.reactnativenavigation.anim.NavigationAnimator $ 1.onAnimationEnd(NavigationAnimator.java:64)          在android.animation.Animator $ AnimatorListener.onAnimationEnd(Animator.java:552)          在android.animation.AnimatorSet.endAnimation(AnimatorSet.java:1294)          在android.animation.AnimatorSet.doAnimationFrame(AnimatorSet.java:1079)          在android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)          在android.animation.AnimationHandler.access $ 100(AnimationHandler.java:37)          在android.animation.AnimationHandler $ 1.doFrame(AnimationHandler.java:54)          在android.view.Choreographer $ CallbackRecord.run(Choreographer.java:1170)          在android.view.Choreographer.doCallbacks(Choreographer.java:984)          在android.view.Choreographer.doFrame(Choreographer.java:806)          在android.view.Choreographer $ FrameDisplayEventReceiver.run(Choreographer.java:1158)          在android.os.Handler.handleCallback(Handler.java:873)          在android.os.Handler.dispatchMessage(Handler.java:99)          在android.os.Looper.loop(Looper.java:193)          在android.app.ActivityThread.main(ActivityThread.java:6863)          在java.lang.reflect.Method.invoke(Method.java)          在com.android.internal.os.RuntimeInit $ MethodAndArgsCaller.run(RuntimeInit.java:537)          在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

这仅在Android应用程序内部发生。我无法重现这种情况,有时会自动发生。在大多数情况下,子屏幕位于父屏幕上方时会发生这种情况。

代码::

Navigation.push(this.props.componentId, {
                component: {
                    id: screenId,
                    name: screenName,
                    passProps: props,
                    options: options
                }
            });

Navigation.popToRoot(this.props.componentId);

我正在使用::

  • 反应本机版本:: 0.58.6
  • 反应本机导航:: 2.12.0

1 个答案:

答案 0 :(得分:0)

我相信#47b7d2c2.13.1-snapshot.234中已解决