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.74k stars 499 forks source link

Invariant Violation: Tried to register two views with the same name AndroidDropdownPicker #390

Closed erikaperugachi closed 3 years ago

erikaperugachi commented 3 years ago

Describe the bug
Show this message: Invariant Violation: Tried to register two views with the same name AndroidDropdownPicker

To Reproduce
1) Install react-native-picker-select@^8.0.2 in your project 2) Run yarn start(ios-android) of your project 3) show this message: Invariant Violation: Tried to register two views with the same name AndroidDropdownPicker 4) install @react-native-community/picker@^1.8 5) run yarn start. And this is ok!

BUT 6) If other member, download the current project with my changes and run yarn install and yarn start 7) show this message: Invariant Violation: Tried to register two views with the same name AndroidDropdownPicker 8) They have to install again the 1.8 of @react-native-community/picker to work again.

Expected behavior
Dont show the message: Invariant Violation: Tried to register two views with the same name AndroidDropdownPicker

Screenshots
you now what I mean

The solution is: in this repo in this package.json should be the version of @react-native-community/picker on ^1.6 or 1.8.1

Additional details

Yashirathore11 commented 3 years ago

Facing the same issue.

lem0n43 commented 3 years ago

I did solution at #3114, but it still didn't work.

milennaj commented 3 years ago

This is not fixed in version 8.0.3 still.

"dependencies": { "@react-native-community/picker": "1.6.0", "lodash.isequal": "^4.5.0" },

@react-native-community/picker is still set to have an exact version 1.6.0

znoland3 commented 3 years ago

having same issue

jehajj commented 3 years ago

+1

Hirurgo commented 3 years ago

same issue

azaidivl commented 3 years ago

+1

CoreyBurkhart commented 3 years ago

I'm getting a very similar error on iOS: Invariant Violation: Tried to register two views with the same name RNCPicker.

As a workaround, using version 7.0.0 doesn't throw the error

mouhsnimohamed commented 3 years ago

having save issue, has some one fix this please?

erikaperugachi commented 3 years ago

My temporal solution was, using this library https://callstack.com/blog/say-goodbye-to-old-fashioned-forks-thanks-to-the-patch-package/ to change in package.json from react-native-picker-select this: "@react-native-community/picker": "1.6.0", to "@react-native-community/picker": "^1.6.0". (adding ^) But first, the last version of @react-native-community/picker should be installed before.

lfkwtz commented 3 years ago

now defaulting to "@react-native-picker/picker": "^1.8.3", with clearer instructions in the readme

PatrickVuscan commented 3 years ago

Hi, I've tried many different combinations of what you've got above, for hours. Could anyone please give me an idea of the best guess of how to fix this?

I'm currently on expo SDK 40.0.0, and this is what my package.json looks like right now...

Note that I tried having this in as well: "@react-native-community/picker": "^1.6.0",


"dependencies": {
   ...
    "@react-native-picker/picker": "^1.8.3",
    ...
    "expo": "^40.0.0",
    "expo-font": "~8.4.0",
    ...
    "native-base": "^2.13.14",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-40.0.0.tar.gz",
    ...
    "react-native-picker-select": "^8.0.4",
    ...
    "react-native-web": "~0.13.12",
    ...
  },
`
Any ideas?