Coder Social home page Coder Social logo

Comments (64)

zouhairjabiri avatar zouhairjabiri commented on July 17, 2024 30

I Fix this probleme by :
Removing import { Picker } from '@react-native-community/picker';
And use import { Picker } from 'react-native'

from picker.

haocse avatar haocse commented on July 17, 2024 28

Fixed for me:
Remove import { Picker } from '@react-native-community/picker';
And use import { Picker } from 'react-native'

from picker.

kesha-antonov avatar kesha-antonov commented on July 17, 2024 11

In my case I had 2 versions in yarn.lock

Added

"resolutions": {
    "@react-native-community/picker": "^1.8.0"
  },

to package.json to fix this

from picker.

Wei102193 avatar Wei102193 commented on July 17, 2024 11

In my case I am using "@react-native-picker/picker": "^1.9.2", and "native-base": "^2.13.14".
Somehow the latest version of "native-base" is using picker from "@react-native-community/picker" which has been deprecated. I believe this is what caused the problem on my side. So I downgrade "native-base" to version 2.13.14 where they still import picker from "react native", and It works fine. Seriously "native-base" caused too much problems, I am thinking remove it completely from my project. Hope this helps someone.

from picker.

sfarkas1988 avatar sfarkas1988 commented on July 17, 2024 7

Same issue here. using import { Picker } from 'react-native' is not a solution as suggested by @haocse

from picker.

orion151 avatar orion151 commented on July 17, 2024 6

I have same issue.
"react-native": "0.62.2",
"@react-native-community/picker": "^1.3.0",

please solve this proble

from picker.

hengkx avatar hengkx commented on July 17, 2024 6

"@react-native-community/picker": "^1.8.1", same issue.

from picker.

johnjoshuadablo avatar johnjoshuadablo commented on July 17, 2024 4

+1

Library version: 0.59.9

Screen Shot 2020-04-22 at 4 31 07 PM

from picker.

KawaljeetSBagga avatar KawaljeetSBagga commented on July 17, 2024 4

+1. Did ANYONE get rid of this?

"react-native": "0.62.0",
"@react-native-community/picker": "^1.3.0"

from picker.

rpCal avatar rpCal commented on July 17, 2024 4

On my code setup...

 <Picker
  selectedValue={formik.values.gender}
  accessibilityLabel={'gender'}
  onValueChange={(itemValue, itemIndex) => {
    formik.setFieldValue('gender', itemValue);
  }}>
  <Picker.Item label="Male" value="MALE" />
  <Picker.Item label="Female" value="FEMALE" />
</Picker>

Issue is related to field accessibilityLabel... If key is setup with any value = err!

from picker.

vijaychouhan-rails avatar vijaychouhan-rails commented on July 17, 2024 4

I installed the NativeBase version that installed "@react-native-picker/picker" "^1.9.7" as dependency and by mistake, I install @react-native-picker/picker too.
So to solve this issue: remove the @react-native-picker/picker that you installed because of NativeBase already installed @react-native-picker/picker as a dependency, if you are using yarn then check on yarn.lock file

from picker.

nandorojo avatar nandorojo commented on July 17, 2024 3

I got a similar error upgrading from Expo SDK 39 -> 40. I solved it by uninstalling @react-native-community/picker and instead installing @react-native-picker/picker.

from picker.

danieljgp2 avatar danieljgp2 commented on July 17, 2024 2

@chakrihacker Probably it does, the bug is caused when a dependency imports the picker from react-native and you import the picker from react-native-community/picker

from picker.

hussainhspl avatar hussainhspl commented on July 17, 2024 2

Is this happening in new rn versions?

yes i am using RN 0.62 app is not running and getting crashed,
and also using native base 2.13.12 version and rn picker ver 1.3.0

from picker.

mrinal-roy avatar mrinal-roy commented on July 17, 2024 2

@haocse the issue comes when we use { Picker } from @react-native-community/picker
With react-native this issue doesnot arise. But with react-native does the {Picker} work in iOS ?

from picker.

jainkuniya avatar jainkuniya commented on July 17, 2024 1

Hi @danieljgp2, thanks for the report. Will look into it. It will be great if you could share some code snippet, through which it is easily reproducible

from picker.

chakrihacker avatar chakrihacker commented on July 17, 2024 1

@danieljgp2 The Android native view name is changed to RNCPicker from RCTPicker but previous versions have name RCTPicker. I think by updating dependency this issue will be solved.

from picker.

orion151 avatar orion151 commented on July 17, 2024 1

In my case, I used @react-native-community/picker": "^1.3.0 and "react-native-google-places-autocomplete": "^1.4.1" in my project.
"react-native-google-places-autocomplete": "^1.4.1" used picker from react-native.
so, occured this error.
Perhaps, there are another pakage using picker from react-native like this in your project.

from picker.

jafar-jabr avatar jafar-jabr commented on July 17, 2024 1

if anyone still has this issue, make sure that you don't use "Picker" from an other package in my case it was "styled-components"

from picker.

rassemdev avatar rassemdev commented on July 17, 2024 1

anybody found any solution except importing from RN!

from picker.

LohanaPawan avatar LohanaPawan commented on July 17, 2024 1

In my case, I used @react-native-community/picker": "^1.3.0 and "react-native-google-places-autocomplete": "^1.4.1" in my project.
"react-native-google-places-autocomplete": "^1.4.1" used picker from react-native.
so, occured this error.
Perhaps, there are another pakage using picker from react-native like this in your project.

Makes sense, but could you please help to understand that how we can know exactly which dependency is in clash with the picker library and how to solve the issue.

from picker.

saim1309 avatar saim1309 commented on July 17, 2024 1

I am also facing the same issue may be for temporary basis I will use it from the react-native or native base. I am using only one picker in one of my components and the moment I import it from '@react-native-community/picker' it throws that error.
Anyways, if anybody come across the solution, please please let us know.

from picker.

grekosys avatar grekosys commented on July 17, 2024 1

Yo tenía el mismo problema. Lo solucione desinstalando react-native-picker-select. Esté tiene conflicto con native-base.

from picker.

MehmetKaplan avatar MehmetKaplan commented on July 17, 2024 1

In my case I had 2 versions in yarn.lock

Added

"resolutions": {
    "@react-native-community/picker": "^1.8.0"
  },

to package.json to fix this

A similar approach solved my case within Expo 40 and for datetimepicker, not picker:

	"resolutions": {
		"@react-native-community/datetimepicker": "3.0.4"
	 },

from picker.

gluons avatar gluons commented on July 17, 2024 1

Uninstall old @react-native-community/picker and install latest @react-native-picker/picker solve this problem for me.

from picker.

DimanshaMalrindu avatar DimanshaMalrindu commented on July 17, 2024 1

The Author renamed the library to @react-native-picker/picker. See the GitHub new repository: https://github.com/react-native-picker/picker It will resolve the issue after uninstalling the @react-native-community-picker library and rename the imported pickers to @react-native-picker/picker. If you use some other features in the @react-native-community, just rename the imported react-native-community/picker to react-native-picker/picker

from picker.

Akhnaten972 avatar Akhnaten972 commented on July 17, 2024

+1

from picker.

danieljgp2 avatar danieljgp2 commented on July 17, 2024

Im facing this error too, this error seems to be related with the dependencies, there is probably a dependency working with the picker of react-native.

Any idea about how to fix it @jainkuniya ?

from picker.

danieljgp2 avatar danieljgp2 commented on July 17, 2024

@jainkuniya which react native version are you using as a dependecy ? i dont know if the problem is related to any dependecy of my project or any dependency of the library but im pretty sure that problem is related with the changes of RN version after 0.59 and the deprecation of the Picker.

from picker.

sofiageo avatar sofiageo commented on July 17, 2024

I ran into this issue. For me it was caused by a wrong import on my project, which was looking for react-native Picker. But what I noticed is that even on react-native 0.61.2 package, this PR was not included. It's probably not a bug just some libraries would need to update their imports.

from picker.

Sroka avatar Sroka commented on July 17, 2024

Any news on this? I have the same problem and cannot get rid of it :/ @sofiageo How did you manage to figure out where offending react-native Picker import was? I check my whole app and there are no usages of Picker. Tried to search in node_nodules to check if some lib uses it but no luck

from picker.

sofiageo avatar sofiageo commented on July 17, 2024

Any news on this? I have the same problem and cannot get rid of it :/ @sofiageo How did you manage to figure out where offending react-native Picker import was? I check my whole app and there are no usages of Picker. Tried to search in node_nodules to check if some lib uses it but no luck

It was easy for me because I only had 2 imports of Picker. How are you searching in node_modules? If it is a multi-import from react-native you will have to only search for the word Picker.

The correct import should be import {Picker} from '@react-native-community/picker';

from picker.

chakrihacker avatar chakrihacker commented on July 17, 2024

Is this bug still exists??

from picker.

chakrihacker avatar chakrihacker commented on July 17, 2024

Is this happening in new rn versions?

from picker.

orion151 avatar orion151 commented on July 17, 2024

I found why this error occurs.

from picker.

orion151 avatar orion151 commented on July 17, 2024

Can you share your package.json file?

from picker.

khalednailigit avatar khalednailigit commented on July 17, 2024

+1

from picker.

hussainhspl avatar hussainhspl commented on July 17, 2024

@danieljgp2 The Android native view name is changed to RNCPicker from RCTPicker but previous versions have name RCTPicker. I think by updating dependency this issue will be solved.

how to update dependency ?

from picker.

MrNoino avatar MrNoino commented on July 17, 2024

I have 3 Pickers in one screen and I solve the same problem as you by adding accessibilityLabel={'pickername'} in all 3 Pickers, with diferent values.

from picker.

MrNoino avatar MrNoino commented on July 17, 2024

I have 3 Pickers in one screen and I solve the same problem as you by adding accessibilityLabel={'pickername'} in all 3 Pickers, with diferent values.

But what when we have to show picker item dynamically through api...

You should use "accessibilityLabel={'pickername'}" in Picker atributes and generate picker items dinamycally unless you have to generate picker dinamically as well.

from picker.

iYahya avatar iYahya commented on July 17, 2024

I have 3 Pickers in one screen and I solve the same problem as you by adding accessibilityLabel={'pickername'} in all 3 Pickers, with diferent values.

But what when we have to show picker item dynamically through api...

You should use "accessibilityLabel={'pickername'}" in Picker atributes and generate picker items dinamycally unless you have to generate picker dinamically as well.

could you attach a screenshot of your solution ?

from picker.

MrNoino avatar MrNoino commented on July 17, 2024

I have 3 Pickers in one screen and I solve the same problem as you by adding accessibilityLabel={'pickername'} in all 3 Pickers, with diferent values.

But what when we have to show picker item dynamically through api...

You should use "accessibilityLabel={'pickername'}" in Picker atributes and generate picker items dinamycally unless you have to generate picker dinamically as well.

could you attach a screenshot of your solution ?

Picker

PS: I use functions to render the elements so if you use class to render, you should realize that "onValueChange" and "selectedValue" work diferent.

from picker.

rohan-yadav007 avatar rohan-yadav007 commented on July 17, 2024

I have 3 Pickers in one screen and I solve the same problem as you by adding accessibilityLabel={'pickername'} in all 3 Pickers, with diferent values.

But what when we have to show picker item dynamically through api...

You should use "accessibilityLabel={'pickername'}" in Picker atributes and generate picker items dinamycally unless you have to generate picker dinamically as well.

could you attach a screenshot of your solution ?

Picker

PS: I use functions to render the elements so if you use class to render, you should realize that "onValueChange" and "selectedValue" work diferent.

I am using class component and using a single dropdown, still getting error. Then i added accessibility as you suggested, still getting same error

from picker.

MrNoino avatar MrNoino commented on July 17, 2024

I have 3 Pickers in one screen and I solve the same problem as you by adding accessibilityLabel={'pickername'} in all 3 Pickers, with diferent values.

But what when we have to show picker item dynamically through api...

You should use "accessibilityLabel={'pickername'}" in Picker atributes and generate picker items dinamycally unless you have to generate picker dinamically as well.

could you attach a screenshot of your solution ?

Picker
PS: I use functions to render the elements so if you use class to render, you should realize that "onValueChange" and "selectedValue" work diferent.

I am using class component and using a single dropdown, still getting error. Then i added accessibility as you suggested, still getting same error

If your error like me is "Tried to resgister two views with the same name AndroidDropdowPicker" like above in screenshoot uploaded by @sislovesmedotcom, you should have at least 2 Pickers because this error is about having the same name (accessibilityLabel) for two or more Pickers. Make sure if you have only one Picker in all Project or atributte diferents values to accessibilityLabel in case you have more than one dropdown. The reason why you have to attibute diferents values to accessibilityLabel is because react native attribute a default value that is equal for every Pickers.

from picker.

rohan-yadav007 avatar rohan-yadav007 commented on July 17, 2024

I have 3 Pickers in one screen and I solve the same problem as you by adding accessibilityLabel={'pickername'} in all 3 Pickers, with diferent values.

But what when we have to show picker item dynamically through api...

You should use "accessibilityLabel={'pickername'}" in Picker atributes and generate picker items dinamycally unless you have to generate picker dinamically as well.

could you attach a screenshot of your solution ?

Picker
PS: I use functions to render the elements so if you use class to render, you should realize that "onValueChange" and "selectedValue" work diferent.

I am using class component and using a single dropdown, still getting error. Then i added accessibility as you suggested, still getting same error

If your error like me is "Tried to resgister two views with the same name AndroidDropdowPicker" like above in screenshoot uploaded by @sislovesmedotcom, you should have at least 2 Pickers because this error is about having the same name (accessibilityLabel) for two or more Pickers. Make sure if you have only one Picker in all Project or atributte diferents values to accessibilityLabel in case you have more than one dropdown. The reason why you have to attibute diferents values to accessibilityLabel is because react native attribute a default value that is equal for every Pickers.

As soon as i import Picker it show error even if i am not using a single drop-down. I think problem lies within the npm package because i get this error just after importing. I am using RN 0.62. Hence it supports autolinking but after getting error several times i thought may be issue is due to bad linking hence tried manual linking. But it didn't help

from picker.

MrNoino avatar MrNoino commented on July 17, 2024

I have 3 Pickers in one screen and I solve the same problem as you by adding accessibilityLabel={'pickername'} in all 3 Pickers, with diferent values.

But what when we have to show picker item dynamically through api...

You should use "accessibilityLabel={'pickername'}" in Picker atributes and generate picker items dinamycally unless you have to generate picker dinamically as well.

could you attach a screenshot of your solution ?

Picker
PS: I use functions to render the elements so if you use class to render, you should realize that "onValueChange" and "selectedValue" work diferent.

I am using class component and using a single dropdown, still getting error. Then i added accessibility as you suggested, still getting same error

If your error like me is "Tried to resgister two views with the same name AndroidDropdowPicker" like above in screenshoot uploaded by @sislovesmedotcom, you should have at least 2 Pickers because this error is about having the same name (accessibilityLabel) for two or more Pickers. Make sure if you have only one Picker in all Project or atributte diferents values to accessibilityLabel in case you have more than one dropdown. The reason why you have to attibute diferents values to accessibilityLabel is because react native attribute a default value that is equal for every Pickers.

As soon as i import Picker it show error even if i am not using a single drop-down. I think problem lies within the npm package because i get this error just after importing. I am using RN 0.62. Hence it supports autolinking but after getting error several times i thought may be issue is due to bad linking hence tried manual linking. But it didn't help

I assume you import "@react-native-community/picker" because the same problem as I, receiving a warning telling that Picker will be descontinued from react-native. I installed this library and I didn't need to linking manually. Then became this error and I fixed by implement the solution that I shared here.
So, my advice to you is reinstall the library and check if you are getting that error yet.

from picker.

rohan-yadav007 avatar rohan-yadav007 commented on July 17, 2024

Finally i found my fixes, I am using styled component in my project, hence to customize picker I used picker into styled to add styling
Capture

After removing this, i get rid of error

from picker.

MrNoino avatar MrNoino commented on July 17, 2024

Finally i found my fixes, I am using styled component in my project, hence to customize picker I used picker into styled to add styling
Capture

After removing this, i get rid of error

I'm glad you fixed the error.

I wish you a good work and nice coding.

from picker.

haocse avatar haocse commented on July 17, 2024

+1

from picker.

haocse avatar haocse commented on July 17, 2024

@mrinal-roy-au2 Yes, iOS app works, this problem happens on the Android app

from picker.

rassemdev avatar rassemdev commented on July 17, 2024

@haocse Picker in React-Native is deprecated. And they are suggesting this one. So need to sort this out within it.

from picker.

introin avatar introin commented on July 17, 2024

+1

from picker.

ovidiumunteanu avatar ovidiumunteanu commented on July 17, 2024

Same Here.
Is there any solution?
I think my error comes from Picker from @react-native-community/picker and react-native-country-picker-modal

from picker.

adrian1388 avatar adrian1388 commented on July 17, 2024

May be you all still are using Picker from 'react-native' somewhere in your project.
Be sure to not import from 'react-native'

Even I can use {Picker} from '@react-native-community/picker' inside styled-components this way:

const MyPicker = styled(Picker)...

This was my case.

from picker.

introin avatar introin commented on July 17, 2024

For now, I have started using Picker from native base library and the issue appears fixed for me albeit few design issue I needed to address in such.

from picker.

raymochi avatar raymochi commented on July 17, 2024

So, I ran into this issue and got it working by changing the name of AndroidDropdownPicker to RNCAndroidDropdownPicker, did the same for dialogpicker.

I opened up a PR for the changes, you can see them here: #99

from picker.

diogoaltoe avatar diogoaltoe commented on July 17, 2024

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.

GeekyAnts/NativeBase#3114 (comment)

from picker.

altany avatar altany commented on July 17, 2024

We are importing two pickers in one scene, made sure to only import from @react-native-community/picker and not "react-native" and tried the trick with adding accessibility labels but I still get this error.

Can someone help with this as we currently have a broken app because of this.

Update: for some reason 1.9.4 was installed in our app. Downgrading to 1.9.3 for all dependencies (which was tested and working before) fixed the issue

from picker.

MehmetKaplan avatar MehmetKaplan commented on July 17, 2024

Seriously "native-base" caused too much problems, I am thinking remove it completely from my project.

Even though I respect the developers of the native-base, I could not have agreed more to above comment. It is generating more problems than it solves, especially with pickers.

from picker.

jdoherty61 avatar jdoherty61 commented on July 17, 2024

#45 (comment) - Was stuck on this for a bit and came across this comment.

from picker.

guicompeng avatar guicompeng commented on July 17, 2024

#15 (comment) and #15 (comment)
Thanks, it worked for me.

from picker.

iguilhermeluis avatar iguilhermeluis commented on July 17, 2024
 <Picker
  selectedValue={formik.values.gender}
  accessibilityLabel={'gender'}
  onValueChange={(itemValue, itemIndex) => {
    formik.setFieldValue('gender', itemValue);
  }}>
  <Picker.Item label="Male" value="MALE" />
  <Picker.Item label="Female" value="FEMALE" />
</Picker>

it work for me!

from picker.

nayookyaw avatar nayookyaw commented on July 17, 2024

I changed react-native-community/datetimepicker version from

2.4.0 to 3.0.9

"@react-native-community/datetimepicker": "^3.0.9"

We can assume the old version will get error

from picker.

dan-fein avatar dan-fein commented on July 17, 2024

I actually realized I didn't need native-base so I just deleted it (which I know isn't possible for everyone) and that worked. I did a little more research after and it looks like I could have upgraded native-base to the latest version and it would have worked. Hope that helps anybody struggling with this one!

from picker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.