Skip to content

NSInternalInconsistencyException - Duplicate states in queue #1061

@Nader-CS

Description

@Nader-CS

Environment

react native : 0.81.6
react-native-pager-view : ^6.9.1
react-native-tab-view : 4.2.2

Platform

ios

Description

App with react native tab view crash in ios only

 Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0xc5964 __exceptionPreprocess
1  libobjc.A.dylib                0x31814 objc_exception_throw
2  Foundation                     0x906b08 _userInfoForFileAndLine
3  UIKitCore                      0xc09fb8 -[_UIQueuingScrollView _enqueueCompletionState:]
4  UIKitCore                      0xc0a28c -[_UIQueuingScrollView _enqueueAnimatedScrollInDirection:withView:completion:]
5  UIKitCore                      0xc0b148 -[_UIQueuingScrollView setView:direction:animated:completion:]
6  UIKitCore                      0xbfde90 -[UIPageViewController _setViewControllers:withScrollInDirection:animated:completion:]
7  UIKitCore                      0xbfe044 -[UIPageViewController setViewControllers:direction:animated:completion:]
8  TimHortons                     0x117636c -[RNCPagerViewComponentView setPagerViewControllers:direction:animated:] + 230 (RNCPagerViewComponentView.mm:230)
9  TimHortons                     0x1175f90 RCTRNCViewPagerHandleCommand + 43 (RCTComponentViewHelpers.h:43)
10 TimHortons                     0x957e64 -[RCTMountingManager synchronouslyDispatchCommandOnUIThread:commandName:args:] + 335 (RCTMountingManager.mm:335)
11 libdispatch.dylib              0x1adc _dispatch_call_block_and_release
12 libdispatch.dylib              0x1b7fc _dispatch_client_callout
13 libdispatch.dylib              0x38b10 _dispatch_main_queue_drain.cold.5
14 libdispatch.dylib              0x10ec8 _dispatch_main_queue_drain
15 libdispatch.dylib              0x10e04 _dispatch_main_queue_callback_4CF
16 CoreFoundation                 0x6a2b4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
17 CoreFoundation                 0x1db3c __CFRunLoopRun
18 CoreFoundation                 0x1ca6c _CFRunLoopRunSpecificWithOptions
19 GraphicsServices               0x1498 GSEventRunModal
20 UIKitCore                      0x9ddf8 -[UIApplication _run]
21 UIKitCore                      0x46e54 UIApplicationMain
22 UIKitCore                      0x172820 -[UIScrollView contentInset]
23 TimHortons                     0x4f64 main (AppDelegate.swift)
24 ???                            0x1941d6e28 (Missing)
Image

Reproducible Demo


const renderTabBar = props => (
   <TabBar
     {...props}
     direction={I18nManager.isRTL ? 'rtl' : 'ltr'}
     tabStyle={styles.tabStyle}
     indicatorStyle={styles.indicatorStyle}
     style={styles.tabBarStyle}
   />
 );

 const renderTabBarLabel = ({_route, labelText, focused}) => (
   <AppText style={[{color: focused ? colors.main_red : colors.black}]}>
     {labelText}
   </AppText>
 );

<View style={styles.horizontalLine} />
           <TabView
             navigationState={{index, routes}}
             renderScene={renderScene}
             direction={I18nManager.isRTL ? 'rtl' : 'ltr'}
             onIndexChange={setIndex}
             initialLayout={initialLayout}
             lazy
             style={styles.tabView}
             renderTabBar={renderTabBar}
             sceneContainerStyle={styles.sceneContainer}
             commonOptions={{
               label: renderTabBarLabel,
             }}
           />
         </View>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: Needs ReproThis issue could be improved with a demo to reproduce the issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions