lawnstarter / react-native-picker-select

🔽 A Picker component for React Native which emulates the native <select> interfaces for iOS and Android
https://npmjs.com/package/react-native-picker-select
MIT License
1.73k stars 490 forks source link

Not Woking with 0.64(Invariant Violation: requireNativeComponent: "RNCAndroidDialogPicker" was not found in the UIManager) #435

Open learncodingforweb opened 3 years ago

learncodingforweb commented 3 years ago

Describe the bug
Invariant Violation: requireNativeComponent: "RNCAndroidDialogPicker" was not found in the UIManager

To Reproduce
Steps to reproduce the behavior:

    <View style={styles.container}>
      <Text>Home Page</Text>
      <RNPickerSelect
        onValueChange={value => console.log(value)}
        useNativeAndroidPickerStyle={false}
        items={[
          {label: 'Football', value: 'football'},
          {label: 'Baseball', value: 'baseball'},
          {label: 'Hockey', value: 'hockey'},
        ]}
      />
    </View>
"dependencies": {
    "react": "17.0.1",
    "react-native": "0.64.0",
    "react-native-picker-select": "^8.0.4"
  },
DwCleb commented 3 years ago

I have the same issue in React Native version 0.64

sclavijo93 commented 3 years ago

I have the same issue in RN 0.63.3

ChristianSeidl commented 3 years ago

I have also a issue with Android RN 0.64.1. I have this issue also with @react-native-picker/picker

I think on my side there is an issue on RN. I come from a screen with a FlatList and a stickyHeader and navigate to a detail screen where the picker is placed. After removing the stickyHeader everything works fine again.

matheusmirandaferreira commented 3 years ago

i have the same problem in version 0.62.2, but just with the expo

Saurabhreactninja commented 3 years ago

You need to install @react-native-community/picker to fix the error.

JanithaR commented 3 years ago

You need to install @react-native-community/picker to fix the error.

It's deprecated.

flora8984461 commented 3 years ago

You need to install @react-native-community/picker to fix the error.

It's deprecated.

It becomes @react-native-picker/picker now https://github.com/react-native-picker/picker

rameshparajuli commented 3 years ago

install @react-native-picker/picker it will remove that error , work for me.

ste7en commented 2 years ago

didn't work for me either! RN version 0.66.0

Pyroboomka commented 2 years ago

Had to patch-package the import in library and install "@react-native-picker/picker" manually. Kinda hacky, but w/e.

diff --git a/node_modules/react-native-picker-select/src/index.js b/node_modules/react-native-picker-select/src/index.js
index 994440f..63aab8a 100644
--- a/node_modules/react-native-picker-select/src/index.js
+++ b/node_modules/react-native-picker-select/src/index.js
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
 import { Keyboard, Modal, Platform, Text, TextInput, TouchableOpacity, View } from 'react-native';
 import PropTypes from 'prop-types';
 import isEqual from 'lodash.isequal';
-import { Picker } from '@react-native-community/picker';
+import {Picker} from '@react-native-picker/picker';
 import { defaultStyles } from './styles';

 export default class RNPickerSelect extends PureComponent {
sagarv1997 commented 1 year ago

Installing https://github.com/react-native-picker/picker fixes the issue

SufianBabri commented 10 months ago

@sagarv1997 thanks but do you know why this resolves the issue? The package.json inside the dependency (i.e. react-native-picker-select) already has that package.

I am actually looking for a way to resolve it without adding this line (lest someone removes it because npx depcheck says the package is unused).

nedgip commented 3 weeks ago

I get this error when loading the Expo example on Android. Installing https://github.com/react-native-picker/picker doesn't resolve it. Does anyone know how I can use this component in Expo Go?

SufianBabri commented 3 weeks ago

@nedgip did you install this library using expo install @react-native-picker/picker? Using npm to install may not install the correct version or dependencies. If it still doesn't work then try clean build.

Also, please mention what version of expo you're using.

nedgip commented 2 weeks ago

@nedgip did you install this library using expo install @react-native-picker/picker? Using npm to install may not install the correct version or dependencies. If it still doesn't work then try clean build.

Also, please mention what version of expo you're using.

I'm just trying to run the Snack example provided in the read me; https://snack.expo.dev/@lfkwtz/react-native-picker-select. When I try to load the examples on Android I get an error - requireNativeComponent: "AndroidDialogPicker" was not found in the UIManager. I've tried with all available versions of Expo, so v51.0.0 back to v48.0.0.

I really want to test the accessibility of the picker on Android and iOS so appreciate any help I can get to get it working.