-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tried to register two views with the same name #15
Comments
+1 |
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 ? |
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 |
@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. |
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. |
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 |
Is this bug still exists?? |
@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 |
@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. |
I have same issue. please solve this proble |
Is this happening in new rn versions? |
I found why this error occurs. |
Can you share your package.json file? |
In my case, I used @react-native-community/picker": "^1.3.0 and "react-native-google-places-autocomplete": "^1.4.1" in my project. |
+1 |
+1. Did ANYONE get rid of this? "react-native": "0.62.0", |
how to update dependency ? |
yes i am using RN 0.62 app is not running and getting crashed, |
On my code setup...
Issue is related to field accessibilityLabel... If key is setup with any value = err! |
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" |
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. |
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 ? |
PS: I use functions to render the elements so if you use class to render, you should realize that "onValueChange" and "selectedValue" work diferent. |
@haocse the issue comes when we use |
@mrinal-roy-au2 Yes, iOS app works, this problem happens on the Android app |
@haocse Picker in React-Native is deprecated. And they are suggesting this one. So need to sort this out within it. |
Same issue here. using |
anybody found any solution except importing from RN! |
+1 |
I Fix this probleme by : |
Same Here. |
May be you all still are using Picker from 'react-native' somewhere in your project. Even I can use {Picker} from '@react-native-community/picker' inside styled-components this way:
This was my case. |
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. |
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. |
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. |
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 |
In my case I had 2 versions in yarn.lock Added
to package.json to fix this |
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. |
"@react-native-community/picker": "^1.8.1", same issue. |
Yo tenía el mismo problema. Lo solucione desinstalando react-native-picker-select. Esté tiene conflicto con native-base. |
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 |
A similar approach solved my case within Expo 40 and for datetimepicker, not picker:
|
In my case I am using "@react-native-picker/picker": "^1.9.2", and "native-base": "^2.13.14". |
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. |
I got a similar error upgrading from Expo SDK 39 -> 40. I solved it by uninstalling |
Uninstall old |
#45 (comment) - Was stuck on this for a bit and came across this comment. |
#15 (comment) and #15 (comment) |
it work for me! |
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 |
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 |
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. |
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! |
Bug
I tried to add the picker, the compilation is fine, but when the app is open appears a red screen with the message:
Tried to register two views with the same name AndroidDropdownPicker
Update: I also use Native base in the project
Can you help me please?
Environment info
React Native Environment Info:
System:
OS: Linux 4.15 Ubuntu 18.04.2 LTS (Bionic Beaver)
CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
Memory: 696.37 MB / 7.68 GB
Shell: 4.4.19 - /bin/bash
Binaries:
Node: 8.9.0 - ~/.nvm/versions/node/v8.9.0/bin/node
Yarn: 1.15.2 - /usr/bin/yarn
npm: 5.5.1 - ~/.nvm/versions/node/v8.9.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
Android SDK:
API Levels: 20, 22, 23, 25, 26, 27, 28
Build Tools: 23.0.1, 25.0.1, 25.0.2, 25.0.3, 26.0.2, 26.0.3, 27.0.0, 27.0.1, 27.0.3, 28.0.3
System Images: android-27 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.9 => 0.59.9
npmGlobalPackages:
react-native-cli: 2.0.1
React native info output:
Library version: 0.59.9
The text was updated successfully, but these errors were encountered: