datetimepicker icon indicating copy to clipboard operation
datetimepicker copied to clipboard

Invariant Violation: requireNativeComponent: "RNDateTimePicker" was not found in the UIManager

Open dmargu opened this issue 7 years ago • 28 comments

Bug

The component appears to not be working. Once my app reaches the screen where the component is called it crashes.

Invariant Violation: Invariant Violation: Invariant Violation: requireNativeComponent: "RNDateTimePicker" was not found in the UIManager.

This error is located at:
    in RNDateTimePicker (at datetimepicker.ios.js:81)
    in RCTView (at View.js:45)
    in View (at datetimepicker.ios.js:80)
    in Picker (at DatePicker.js:38)
    in RCTView (at View.js:45)
    in View (at DatePicker.js:31)
    in DatePicker (at HomeScreen.js:18)
    in RCTScrollContentView (at ScrollView.js:976)
    in RCTScrollView (at ScrollView.js:1115)
    in ScrollView (at HomeScreen.js:14)
    in RCTView (at View.js:45)
    in View (at HomeScreen.js:13)
    in HomeScreen (at SceneView.js:9)
    in SceneView (at DrawerView.js:149)
    in RCTView (at View.js:45)
    in View (at ResourceSavingScene.js:20)
    in RCTView (at View.js:45)
    in View (at ResourceSavingScene.js:16)
    in ResourceSavingScene (at DrawerView.js:148)
    in RCTView (at View.js:45)
    in View (at screens.native.js:83)
    in ScreenContainer (at DrawerView.js:138)
    in RCTView (at View.js:45)
    in View (at createAnimatedComponent.js:151)
    in AnimatedComponent (at DrawerLayout.js:446)
    in RCTView (at View.js:45)
    in View (at createAnimatedComponent.js:151)
    in AnimatedComponent (at DrawerLayout.js:445)
    in PanGestureHandler (at DrawerLayout.js:501)
    in DrawerLayout (at DrawerView.js:165)
    in DrawerView (at createNavigator.js:61)
    in Navigator (at createAppContainer.js:429)
    in NavigationContainer (at SceneView.js:9)
    in SceneView (at createTabNavigator.js:39)
    in RCTView (at View.js:45)
    in View (at ResourceSavingScene.js:37)
    in RCTView (at View.js:45)
    in View (at ResourceSavingScene.js:26)
    in ResourceSavingScene (at createBottomTabNavigator.js:121)
    in RCTView (at View.js:45)
    in View (at screens.native.js:83)
    in ScreenContainer (at createBottomTabNavigator.js:111)
    in RCTView (at View.js:45)
    in View (at createBottomTabNavigator.js:110)
    in TabNavigationView (at createTabNavigator.js:197)
    in NavigationView (at createNavigator.js:61)
    in Navigator (at createAppContainer.js:429)
    in NavigationContainer (at App.js:38)
    in ViewManagerAdapter_ExpoLinearGradient (at NativeViewManagerAdapter.js:49)
    in ForwardRef(Adapter<ExpoLinearGradient>) (at NativeLinearGradient.ios.js:5)
    in NativeLinearGradient (at LinearGradient.js:12)
    in LinearGradient (at App.js:37)
    in Provider (at App.js:36)
    in App (at withExpoRoot.js:20)
    in RootErrorBoundary (at withExpoRoot.js:19)
    in ExpoRootComponent (at renderApplication.js:35)
    in RCTView (at View.js:45)
    in View (at AppContainer.js:98)
    in RCTView (at View.js:45)
    in View (at AppContainer.js:115)
    in AppContainer (at renderApplication.js:34)

This error is located at:
    in NavigationContainer (at SceneView.js:9)
    in SceneView (at createTabNavigator.js:39)
    in RCTView (at View.js:45)
    in View (at ResourceSavingScene.js:37)
    in RCTView (at View.js:45)
    in View (at ResourceSavingScene.js:26)
    in ResourceSavingScene (at createBottomTabNavigator.js:121)
    in RCTView (at View.js:45)
    in View (at screens.native.js:83)
    in ScreenContainer (at createBottomTabNavigator.js:111)
    in RCTView (at View.js:45)
    in View (at createBottomTabNavigator.js:110)
    in TabNavigationView (at createTabNavigator.js:197)
    in NavigationView (at createNavigator.js:61)
    in Navigator (at createAppContainer.js:429)
    in NavigationContainer (at App.js:38)
    in ViewManagerAdapter_ExpoLinearGradient (at NativeViewManagerAdapter.js:49)
    in ForwardRef(Adapter<ExpoLinearGradient>) (at NativeLinearGradient.ios.js:5)
    in NativeLinearGradient (at LinearGradient.js:12)
    in LinearGradient (at App.js:37)
    in Provider (at App.js:36)
    in App (at withExpoRoot.js:20)
    in RootErrorBoundary (at withExpoRoot.js:19)
    in ExpoRootComponent (at renderApplication.js:35)
    in RCTView (at View.js:45)
    in View (at AppContainer.js:98)
    in RCTView (at View.js:45)
    in View (at AppContainer.js:115)
    in AppContainer (at renderApplication.js:34)

This error is located at:
    in NavigationContainer (at App.js:38)
    in ViewManagerAdapter_ExpoLinearGradient (at NativeViewManagerAdapter.js:49)
    in ForwardRef(Adapter<ExpoLinearGradient>) (at NativeLinearGradient.ios.js:5)
    in NativeLinearGradient (at LinearGradient.js:12)
    in LinearGradient (at App.js:37)
    in Provider (at App.js:36)
    in App (at withExpoRoot.js:20)
    in RootErrorBoundary (at withExpoRoot.js:19)
    in ExpoRootComponent (at renderApplication.js:35)
    in RCTView (at View.js:45)
    in View (at AppContainer.js:98)
    in RCTView (at View.js:45)
    in View (at AppContainer.js:115)
    in AppContainer (at renderApplication.js:34)
- node_modules/react-native/Libraries/ReactNative/getNativeComponentAttributes.js:29:4 in getNativeComponentAttributes
- node_modules/react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js:104:25 in get
- ... 18 more stack frames from framework internals


Library version: 1.0.0

Steps To Reproduce

  1. npm install --save @react-native-community/datetimepicker
  2. expo start

Describe what you expected to happen:

  1. For a button to appear where I could press and open the date picker

dmargu avatar Jul 25 '19 19:07 dmargu

This package does not work with React Native .60

adam-s avatar Jul 29 '19 19:07 adam-s

Seems sort of buggy but going into src/ios and running pod install might find the dependancy.

https://github.com/react-native-community/react-native-datetimepicker#manual-installation

denistsoi avatar Jul 29 '19 19:07 denistsoi

Thank your for reporting. I'm currently working on doing a full update to support 0.60, I'll make sure to verify that it works as expected. The work in progress can be found here https://github.com/react-native-community/react-native-datetimepicker/pull/13

That said I did notice the reference to expo

  1. expo start

I don't think expo by default supports native modules other than a set of modules from React Native itself and a selection of handpicked native API's. But please correct me if I'm wrong.

Swaagie avatar Jul 30 '19 10:07 Swaagie

@dmargu @adam-s I've just published @react-native-community/[email protected] which works against React Native 0.60, let me know if that resolves your build or runtime issues.

Swaagie avatar Aug 13 '19 08:08 Swaagie

@Swaagie is there anything different we need to do on version 2.0.0 to work with RN 60? https://github.com/react-native-community/react-native-datetimepicker#manual-installation I'm not able to build it, it looks it has something to do with the use_frameworks! https://github.com/facebook/react-native/issues/25349

zubjorge avatar Aug 21 '19 22:08 zubjorge

This combination is also not working:

"@react-native-community/datetimepicker": "^2.0.0", "react": "^16.8.6", "react-native": "^0.60.5"

Same error as the original poster when building/running on iOS

mrcl3an avatar Aug 28 '19 23:08 mrcl3an

@mrcl3an Did you try doing pod install and restarting the Metro Bundler?

evrimfeyyaz avatar Sep 11 '19 12:09 evrimfeyyaz

I am using expo 34.0.1 and I have encountered this problem.

  "expo": "^34.0.1"
React-native link
Expo install @react-native-community/datetimepicker

Have tried, still have problems

rendongsc avatar Sep 17 '19 09:09 rendongsc

I have the same problem, are there any solutions?

vincentzierigen avatar Sep 23 '19 23:09 vincentzierigen

expo 35.0.0 (bare workflow) - the same issue

DMezhenskyi avatar Sep 24 '19 19:09 DMezhenskyi

I might be mistaken, but if you are using a managed expo workflow it seems this package will not work because expo does not support native modules and this package is a native module https://docs.expo.io/versions/latest/introduction/faq/ (search for "native modules")

Nnoerregaard avatar Sep 25 '19 10:09 Nnoerregaard

@Nnoerregaard I am using the bare workflow which supports native modules https://docs.expo.io. So the issue is with something else :(

DMezhenskyi avatar Sep 25 '19 18:09 DMezhenskyi

@Swaagie @dmargu @adam-s I've just published @react-native-community/[email protected] which works against React Native 0.60, let me know if that resolves your build or runtime issues.

I'm still getting the same error, but only on ios and not on android. Library version @react-native-community/[email protected] Invariant Violation: requireNativeComponent: "RNDateTimePicker" was not found in the UIManager

yash-atreya avatar Oct 16 '19 13:10 yash-atreya

I've this:

Invariant Violation: Invariant Violation: requireNativeComponent: "DatePickerManager" was not found in the UIManager.

  • node_modules/react-native/Libraries/ReactNative/getNativeComponentAttributes.js:29:4 in getNativeComponentAttributes
  • node_modules/react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js:104:25 in get
  • ... 18 more stack frames from framework internals

redBaron23 avatar Oct 19 '19 02:10 redBaron23

Any solutions for this?

React Native: 0.61.2 @react-native-community/datetimepicker: 2.1.0

avtarnanrey avatar Oct 19 '19 23:10 avtarnanrey

Adding pod 'RNDateTimePicker', :path => '../node_modules/@react-native-community/datetimepicker/RNDateTimePicker.podspec' in podfile solved it.

"react-native": "0.61.2", "@react-native-community/datetimepicker": "^2.1.0", "react-native-modal-datetime-picker": "8.x.x",

SallarBhutto avatar Oct 24 '19 14:10 SallarBhutto

Yeah, adding RNDateTimePicker to the Podfile or using an autolink mechanism from react-native should solve this problem. Also, I've just merged https://github.com/expo/expo/pull/6087 so this native module will be a part of the next Expo SDK (36) so you will be able to use it in managed workflow as well 🎉

tsapeta avatar Oct 29 '19 09:10 tsapeta

Same error, on React-native 0.60.5.

Only in iOS.

The podfile hotfix does't works here.

leonardomarciano avatar Nov 11 '19 13:11 leonardomarciano

Using react-native link and installing pods fixed this issue for me, on RN 0.60.3. Not sure why this section was removed from readme.

react-native link @react-native-community/datetimepicker && cd ios && pod install

joelrorseth avatar Nov 24 '19 18:11 joelrorseth

@avtarnanrey

React Native: 0.61.2 @react-native-community/datetimepicker: 2.1.0

  • install (npm install / yarn install)
  • cd ios
  • pod install

*no need to link

works for me

rzdev avatar Dec 11 '19 17:12 rzdev