react-native-picker-select icon indicating copy to clipboard operation
react-native-picker-select copied to clipboard

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

Open ravi-poonia opened this issue 3 years ago • 11 comments

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.

ravi-poonia avatar Dec 15 '20 10:12 ravi-poonia

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

ravi-poonia avatar Dec 15 '20 10:12 ravi-poonia

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

raldred avatar Dec 15 '20 23:12 raldred

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

prasad456 avatar Dec 18 '20 05:12 prasad456

Maybe fixed by 1.9.6 then https://github.com/react-native-picker/picker/pull/190

raldred avatar Dec 18 '20 13:12 raldred

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

ajoykarmakar459 avatar Jan 14 '21 07:01 ajoykarmakar459

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 !

mustapha-ghlissi avatar Jan 29 '21 09:01 mustapha-ghlissi

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?

zoultrex avatar Mar 03 '21 22:03 zoultrex

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

dustinyoste avatar Mar 11 '21 00:03 dustinyoste

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!

akash-bhadani avatar Apr 09 '21 10:04 akash-bhadani

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 !

thanks fixed issue through this method in "react-native": "0.70.1",

ahsan-abrar avatar Oct 06 '22 14:10 ahsan-abrar

got this error as well but if you stop the simulator (weather it's expo simulator or ios or whatever) and restart it it may go away - if you npm / yarn install while simulator is running in some other terminal, and just navigate to the window you added the Picker to this error will come up

zagros avatar Sep 11 '23 19:09 zagros