react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

[V2] setStackRoot crash

Open leandr0ck opened this issue 8 years ago • 4 comments

Issue Description

The application is crashing when try to change the layout with setStackRoot

Steps to Reproduce / Code Snippets / Screenshots

    Navigation.setStackRoot(this.props.componentId, {
      bottomTabs: {
        children: [
          {
            stack: {
              children: [],
              options: {
                bottomTab: {
                  text: 'Tab 1',
                },
              },
            },
          },
          {
            component: {
              name: 'organization.componentName',
              options: {
                bottomTab: {
                  text: 'Tab 2',
                },
              },
            },
          },
        ],
      },
    });

Environment

  • React Native Navigation version: 2.0.2452
  • React Native version: 0.56.0
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Android Emulator v. 27.3.9-4899998 -- 6.0 (Marshmallow) - API 23 (Rev 1)

leandr0ck avatar Aug 07 '18 20:08 leandr0ck

Here is the logcat:

  java.lang.NullPointerException: Attempt to invoke virtual method 'int com.aurelhubert.ahbottomnavigation.AHBottomNavigation.getCurrentItem()' on a null object reference
        at com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabsController.getCurrentChild(BottomTabsController.java:114)
        at com.reactnativenavigation.viewcontrollers.ParentController.resolveCurrentOptions(ParentController.java:45)
        at com.reactnativenavigation.viewcontrollers.ParentController.resolveCurrentOptions(ParentController.java:46)
        at com.reactnativenavigation.viewcontrollers.ParentController.resolveCurrentOptions(ParentController.java:54)
        at com.reactnativenavigation.viewcontrollers.stack.StackController.push(StackController.java:132)
        at com.reactnativenavigation.viewcontrollers.stack.StackController.setRoot(StackController.java:166)
        at com.reactnativenavigation.viewcontrollers.Navigator.lambda$setStackRoot$2$Navigator(Navigator.java:144)
        at com.reactnativenavigation.viewcontrollers.Navigator$$Lambda$2.run(Unknown Source)
        at com.reactnativenavigation.viewcontrollers.ViewController.performOnParentStack(ViewController.java:130)
        at com.reactnativenavigation.viewcontrollers.Navigator.setStackRoot(Navigator.java:144)
        at com.reactnativenavigation.react.NavigationModule.lambda$setStackRoot$5$NavigationModule(NavigationModule.java:95)
        at com.reactnativenavigation.react.NavigationModule$$Lambda$5.run(Unknown Source)
        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:6077)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)

leandr0ck avatar Aug 08 '18 14:08 leandr0ck

For Android you NEED to specify icons and your tab 1's stack should have some sort of component?

ItsNoHax avatar Aug 09 '18 11:08 ItsNoHax

My bad, copy pasted from here: https://wix.github.io/react-native-navigation/v2/#/docs/layout-types

leandr0ck avatar Aug 09 '18 13:08 leandr0ck

Hi @lean , did it work for you? can you paste your config? it still does not work for me :(

RiCoTeRoX avatar Oct 03 '18 16:10 RiCoTeRoX