React-native-picker-select: Invariant Violation: requireNativeComponent: "RNCAndroidDialogPicker" was not found in the UIManager.

Created on 15 Dec 2020  路  9Comments  路  Source: lawnstarter/react-native-picker-select


Describe the bug

Followed all the steps mentioned in Readme.
Throws error in android : Invariant Violation: requireNativeComponent: "RNCAndroidDialogPicker" was not found in the UIManager.

To Reproduce

Steps to reproduce the behavior:

Install and run the package with the default config on android.

Expected behavior

The app should not crash for android

Screenshots

Additional details

  • Device: android emulator
  • OS: Android 10
  • react-native-picker-select version: 8.0.4
  • react-native version: 0.63.4
  • @react-native-picker/picker : ^1.9.4"

Reproduction and/or code sample

Provide a link to a reproduction of this issue on https://snack.expo.io or an explanation why you can not. Not including a snack link will result in a significant delay in our ability to address this issue.


Most helpful comment

The solution is to install correctly the lib and its dependency:

npm install react-native-picker-select
npm install @react-native-picker/picker

If the error always persists, just enter this command line to link manually the lib:
npx react-native link

_Enjoy !_

All 9 comments

Downgrading @react-native-picker/picker to 1.8.3 worked for me. 馃挴

Not really closed, as this is an issue, out the box the Picker fails.
Due to this issue
image

Having this issue in iOS Simulator, but after installing this @react-native-picker/picker : ^1.9.4" package issue fixed.

This fixed the issue for me -

npx react-native link
android -
re-run react-native run-android command

ios - 
cd ios
pod install
re-run react-native run-ios command

The solution is to install correctly the lib and its dependency:

npm install react-native-picker-select
npm install @react-native-picker/picker

If the error always persists, just enter this command line to link manually the lib:
npx react-native link

_Enjoy !_

The solution is to install correctly the lib and its dependency:

npm install react-native-picker-select
npm install @react-native-picker/picker

If the error always persists, just enter this command line to link manually the lib:
npx react-native link

_Enjoy !_

Doing this I get Invariant Violation: Tried to register two views with the same name RNCAndroidDropdownPicker
Did you have this problem too and managed to solve it somehow?

Took quite a few gathered steps to get the update working for me, you might not require all of these, but maybe they can help.

Firstly, I did update to react-native v0.63.4 (probably not necessary).

These steps come after upgrading this, react-native-picker-select, package to 8.0.3

  1. npm install @react-native-picker/[email protected]

  2. Add to package.json

    "resolutions": {
        "react-native-picker-select/**/@react-native-picker/picker": "1.8.3"
    },
  1. react-native link @react-native-picker/picker

  2. Add to android/app/build.gradle

dependencies {
    ... 
    implementation project(':@react-native-picker_picker')
}
  1. watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn start -- --reset-cache

  2. cd android && ./gradlew clean

  3. cd ios && pod install

Hello Everyone!

I was facing the same issue

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

when I installed npm install react-native-picker-select and used their Basic Usage example in React Native CLI.

import RNPickerSelect from 'react-native-picker-select';

export const Dropdown = () => {
    return (
        <RNPickerSelect
            onValueChange={(value) => console.log(value)}
            items={[
                { label: 'Football', value: 'football' },
                { label: 'Baseball', value: 'baseball' },
                { label: 'Hockey', value: 'hockey' },
            ]}
        />
    );
};

I tried installing another package named @react-native-community/picker using npm install @react-native-community/picker in your project's root directory. This helped me solve the error.

Try Installing the same package and link it with your project (if required).

Enjoy!

Was this page helpful?
0 / 5 - 0 ratings