使用bottomTabs尝试推送到新屏幕时,应用崩溃

时间:2019-06-05 15:41:58

标签: react-native react-native-navigation

我有一个带有底部选项卡的堆栈视图,当我尝试从初始/第一个选项卡推送到新屏幕时,应用程序不断崩溃。我已经注册了该屏幕,并且当我在第二个选项卡屏幕中放置相同的按钮时,该屏幕也可以使用。

onPress = () => {
    Navigation.push(this.props.componentId, {
        component:{
            name: "NewScreen"
        }
    })
}

<Button title="GOTO" onPress={this.onPress} />

我遇到以下错误。

java.lang.NullPointerException: Attempt to invoke virtual method 'float java.lang.Float.floatValue()' on a null object reference
    at com.aurelhubert.ahbottomnavigation.AHBottomNavigation.setTitleInactiveTextSizeInSp(AHBottomNavigation.java:1184)
    at com.reactnativenavigation.presentation.BottomTabPresenter.applyOptions(BottomTabPresenter.java:55)
    at com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabsController.applyOptions(BottomTabsController.java:90)
    at com.reactnativenavigation.viewcontrollers.ViewController.onViewAppeared(ViewController.java:208)
    at com.reactnativenavigation.viewcontrollers.ChildController.onViewAppeared(ChildController.java:34)
    at com.reactnativenavigation.viewcontrollers.ViewController.onGlobalLayout(ViewController.java:261)
    at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:945)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2357)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7183)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
    at android.view.Choreographer.doCallbacks(Choreographer.java:761)
    at android.view.Choreographer.doFrame(Choreographer.java:696)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6669)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

0 个答案:

没有答案