picker icon indicating copy to clipboard operation
picker copied to clipboard

Tried to register two views with the same name AndroidDropdownPicker

Open MrLibya opened this issue 6 years ago • 20 comments

all the package are updated, the picker is work very well import {Picker} from '@react-native-community/picker';

but when i import button from native base i got this error Tried to register two views with the same name AndroidDropdownPicker import {Button} from 'native-base' when i delete it the error go as well , so i think its kind of conflict between the picker community and native base versions.

MrLibya avatar May 24 '20 06:05 MrLibya

Im facing the same problem, native-base is there in my node_modules, however Im not using it in the component where I added import {Picker} from '@react-native-community/picker'; Not sure why its not working

phoenixxd avatar May 24 '20 15:05 phoenixxd

Facing same problem, Before i was using Picker from 'react-native ' now when its Deprecated so I switched to Picker from ''@react-native-community/picker';' and I am getting Error "Invariant Violation: Tried to register two views with the same name AndroidDropdownPicker", I am also using some classes from "native-base" if that is making this issue so how could i use them ?

farhanmeo avatar Jun 05 '20 20:06 farhanmeo

+1

introin avatar Jun 07 '20 17:06 introin

I renamed the import and it worked!

import { Picker as Select } from '@react-native-community/picker';

JoaoPedroCJ avatar Jun 11 '20 02:06 JoaoPedroCJ

I renamed the import and it worked!

import { Picker as Select } from '@react-native-community/picker';

still doesn't work for me..

shimonemu avatar Jun 11 '20 07:06 shimonemu

+1

khjde1207 avatar Jun 12 '20 07:06 khjde1207

+1

solidw avatar Jun 14 '20 18:06 solidw

In my case, I tried to use Picker from 'react-native' but it was deprecated. So I add '@react-native-community/picker' and import Picker from @react-native-community/picker

The bug was occured when I doing import community/picker and finally I solved with removing const MyPicker = styled.Picker``;. I guess styled.Picker <= means Picker in react-native(deprecated). Thus we can show Tried to register ~ because of duplicated Picker

solidw avatar Jun 14 '20 18:06 solidw

I opened a pr to fix this issue here: https://github.com/react-native-community/react-native-picker/pull/99

raymochi avatar Jun 18 '20 03:06 raymochi

@raymochi Thanks for the fix! We've released 1.6.5 that includes the fix :tada:

Naturalclar avatar Jun 21 '20 01:06 Naturalclar

Downloaded the latest version still giving me the error Tried to register two views with the same name AndroidDropdownPicker

strikeric11 avatar Jun 25 '20 07:06 strikeric11

downloaded the latest version, still seeing this error.

vong-srey avatar Jul 11 '20 02:07 vong-srey

Still getting the same error Invariant Violation: Tried to register two views with the same name RNCAndroidDropdownPicker

dexiouz avatar Sep 28 '20 14:09 dexiouz

if you're using react-native-picker-select, see https://github.com/lawnstarter/react-native-picker-select/issues/374

sjungwirth avatar Oct 09 '20 17:10 sjungwirth

In my case, here is the way I found to temporarily solve the problem. It is obviously not the best way, but it was the one I found at the time.

https://github.com/GeekyAnts/NativeBase/issues/3114#issuecomment-706439559

diogoaltoe avatar Oct 09 '20 23:10 diogoaltoe

I am having a similar issue with this. I get the following error message - Invariant Violation: Tried to register two views with the same name RNCAndroidDropdownPicker

My import statement looks like the following :

 import { Picker } from "@react-native-picker/picker";

I have tried this fix but it didn't work. Let's see where this goes. 👍🏽

devivekw avatar Jan 07 '21 20:01 devivekw

Looks like native-base implements @react-native-picker/picker for its Picker component, so if you already have native-base installed, use it instead:

 import { Picker } from "native-base";

rayonnunes avatar Jan 15 '21 21:01 rayonnunes

+1

lordival avatar Jan 20 '21 03:01 lordival

Looks like native-base implements @react-native-picker/picker for its Picker component, so if you already have native-base installed, use it instead:

 import { Picker } from "native-base";

Thx dude, it works for me

LevMisiliuk avatar Feb 14 '21 21:02 LevMisiliuk

Importing Picker from native-base didn't work for me.

As I only have a limited number of Native-Base components in my app, one solution is to ensure the NativeBase Picker code is not used.

- import { Root as NativeBaseRoot } from 'native-base';
+ import { Root as NativeBaseRoot } from 'native-base/src/basic/Root';

Not a great solution and can't work for everyone but was helpful for me

slorber avatar May 05 '21 16:05 slorber