Open wadewadewadewadewadewade opened 4 years ago
Im also facing this issue in bare workflow.
System: OS: macOS 10.15.5 CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz Memory: 6.62 GB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node Yarn: 1.22.4 - ~/.nvm/versions/node/v10.15.3/bin/yarn npm: 6.14.7 - ~/.nvm/versions/node/v10.15.3/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.9.1 - /Users/user.rvm/gems/ruby-2.5.1/bin/pod SDKs: iOS SDK: Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2 Android SDK: Not Found IDEs: Android Studio: 3.1 AI-173.4819257 Xcode: 11.6/11E708 - /usr/bin/xcodebuild Languages: Java: 13.0.2 - /usr/bin/javac Python: 2.7.13 - /Library/Frameworks/Python.framework/Versions/2.7/bin/python npmPackages: @react-native-community/cli: Not Found react: ~16.13.1 => 16.13.1 react-native: 0.63.2 => 0.63.2 npmGlobalPackages: react-native: Not Found
Same issue here!
After searching for this problem, I update expo with npm and run "expo update". That solve the issue. Hope this may help.
Thanks Juan!
What version of react native picker did you end up with after running expo update?
On Mon, Sep 7, 2020, 8:41 AM Juan Barberis notifications@github.com wrote:
After searching for this problem, I update expo with npm and run "expo update". That solve the issue. Hope this may help.
ā You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/react-native-community/react-native-picker/issues/136#issuecomment-688400281, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFRRH6UKEBEUVEA22UPSTK3SET5KVANCNFSM4Q2JOVBQ .
The version of react native picker after update: "@react-native-community/picker": "1.6.0"
And expo diagnostics after update: Expo CLI 3.26.2 environment info: System: OS: Linux 5.4 Pop!_OS 20.04 LTS Shell: 5.8 - /usr/bin/zsh Binaries: Node: 12.18.3 - /usr/local/bin/node npm: 6.14.6 - /usr/local/bin/npm npmPackages: expo: ^38.0.0 => 38.0.10 react: 16.11.0 => 16.11.0 react-dom: 16.11.0 => 16.11.0 react-native: https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz => 0.62.2 react-native-web: ~0.11.7 => 0.11.7 npmGlobalPackages: expo-cli: 3.26.2
Thanks for that info!
Unfortunately the snack I have set up to test this still errors with 1.6.0, although with a different error compared to 1.6.6: https://snack.expo.io/Lids0AJ0V
Tried to register two views with the same name RNCAndroidDropdownPicker
Evaluating @react-native-community/picker.js
Evaluating App.tsx.js
Loading App.tsx
For what it's worth, I got react-native-picker-select
to work with my project. It might not look as pretty, but such is life...
Hope you can solve it. I'm very new with React.
Juan.
Facing the same issue here.
I'm using NativeBase in my application they user Picker from react-native.
when I created a custom component using Picker from "@react-native-community/picker": "1.6.0"
I got error like
Invariant Violation: Tried to register two views with the same name AndroidDropdownPicker.
then I upgraded the package to 1.6.6.
now getting this error
Invariant Violation: requireNativeComponent: "RNCAndroidDialogPicker" was not found in the UIManager
in android.
"@react-native-community/picker": "1.6.6",
"expo": "^38.0.0",
"native-base": "2.13.14",
"react": "16.11.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz"
@wadewadewadewadewadewade react-native-picker-select uses"@react-native-community/picker": "^1.6.0"
causing a different error when using NativeBase in the application
@arunpugahz Interesting! I haven't used native-base. But I do know that @react-native-community/picker
says it's not supposed to be use with expo 37. I think they really mean expo 37 and recent, no?
But weirdly I got "react-native-picker-select": "^7.0.0"
to work with "expo": "^38.0.0"
, and if what you say is true that react-native-picker-select
uses @react-native-community/picker
and not picker from react-native, then I'm stumped on why I couldn't get "@react-native-community/picker": "^1.6.0"
to work on Android in that snack I've been using: https://snack.expo.io/Lids0AJ0V
@wadewadewadewadewadewade sorry I was not clear, "react-native-picker-select": "^7.0.0"
uses Picker from 'react-native'
, hence its working fine but its not advisable because Picker is moved. but if you update react-native-picker-select
to 8.0.0
it causes the same
Invariant Violation: requireNativeComponent: "RNCAndroidDialogPicker" was not found in the UIManager
because it uses @react-native-community/picker
Ah, that makes more sense. Thank you for clarifying!
That's weird that newer expo relies on a deprecated picker library. Is this maybe an expo problem and not a react-native-community problem - should we maybe go bug the expo repo maintainers?
On Tue, Sep 8, 2020 at 10:38 AM ArunPugahz notifications@github.com wrote:
@wadewadewadewadewadewade https://github.com/wadewadewadewadewadewade sorry I was not clear, "react-native-picker-select": "^7.0.0" uses Picker from 'react-native', hence its working fine but its not advisable because Picker is moved. but if you update react-native-picker-select to 8.0.0 it causes the same Invariant Violation: requireNativeComponent: "RNCAndroidDialogPicker" was not found in the UIManager because it uses @react-native-community/picker
ā You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/react-native-community/react-native-picker/issues/136#issuecomment-689031654, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFRRH6XTJDPDZCTNXJYKZFLSEZTYPANCNFSM4Q2JOVBQ .
Has anyone been able to resolve this issue?
@shahmharsh The only solution I found was to use a different picker. But @arunpugahz pointed out that "react-native-picker-select": "^7.0.0"
should work, just not ^8.0.0. but I haven't confirmed that directly.
So you could try using that older version of react-native-pciker-select
I'm having the same error but if I switch to the deprecated version of picker available in 'react-native' it doesn't error out on me, really strange.
This is happening as well on RN 0.63, without expo
^ still happening as well on latest RN version
oh , i managed it myself (i'm not using expo)
how do i get the error "requireNativeComponent ..." :
<Picker> ... </Picker>
like sothen the way i fixed it :
i closing my application, i stopped my metro server, cleaning metro cache and also run watchman watch-del-all
i re run command "npm run android" and let the gradle build my application once again
let this task done by gradle
i went to the component where i put the <Picker> .... </Picker>
and the errors is gone, i can use this package without facing a this error again
*this is the way i fixed this issue on "mine" and idk if its different by u guys
cheers~ hope yall fixed the issue soon too
@kalleriakronos24 method didn't work for me :(. I still with the problem.
Manually linking helped me resolve the issue, but don't follow the steps mentioned in the readme.
import com.reactnativecommunity.picker.RNCPickerPackage;
to the imports at the top of the file
Add new RNCPickerPackage()
to the list returned by the getPackages()
methodinclude ':@react-native-community_picker' project(':@react-native-community_picker').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/picker/android')
implementation project(':@react-native-community_picker')
Hope this helps someone! Cheers! š
I tried react-native run-android
after installing the issue solved
Manually linking helped me resolve the issue, but don't follow the steps mentioned in the readme.
- Open application file (android/app/src/main/java/[...]/MainApplication.java) Add
import com.reactnativecommunity.picker.RNCPickerPackage;
to the imports at the top of the file Addnew RNCPickerPackage()
to the list returned by thegetPackages()
method- Append the following lines to android/settings.gradle:
include ':@react-native-community_picker' project(':@react-native-community_picker').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/picker/android')
- Insert the following lines inside the dependencies block in android/app/build.gradle:
implementation project(':@react-native-community_picker')
Hope this helps someone! Cheers! š
for me was kind of similar but in "android/app/build.gradle" I had to place:
implementation project(path: ':@react-native-community_picker')
If you see a Invariant Violation: requireNativeComponent "RNCPicker" was not found in the UIManager
error:
React Native users: npm install @react-native-community/picker npx pod-install
Expo: expo install @react-native-community/picker
It works for me!
if you're using react-native-cli, you should clean android build ./gradlew clean
on android folder. and watchman watch-del-all && yarn start --reset-cache
to make sure all cache are clean.
@kalleriakronos24 works perfect for me,
thx for giving me a clue for what really happened to that issue, i don't know the cause of the error at the first time until you explain how you get the error "requireNativeComponent ..." and that is exactly the same thing as mine
but for my case, i just re-start the metro server and run yarn run android
without cleaning cache and without rebuild the app. It solved
those who are having this issue with Native Base like me. Installing expo install @react-native-community/picker
solved my issue. I am still using picker from native base but problem solved.
If you see a
Invariant Violation: requireNativeComponent "RNCPicker" was not found in the UIManager
error:React Native users: npm install @react-native-community/picker npx pod-install
Expo: expo install @react-native-community/picker
It works for me!
This worked for me too
The fact is, that package: @react-native-community/picker is deprecated ā My solution was adding react-native-picker/picker package to the project ā
The problem is as @hrdyjan1 answered that @react-native-community/picker
is deprecated,
however using react-native-picker/picker
might not be the best idea if you're using the newest iOS version in your app because Apple changed their component and even react-native-picker/picker
might still cause problems.
I suggest using
react-native-dropdown-picker
I trie all the other solutions above and the only thing that worked for me was adding the react-native-picker/picker
Thanks @hrdyjan1
if you're using react-native-cli, you should clean android build
./gradlew clean
on android folder. andwatchman watch-del-all && yarn start --reset-cache
to make sure all cache are clean.
Thnx, these solution solved my prblm without watchman watch-del-all && yarn start --reset-cache
Has anyone already done these steps for the new @react-native-picker/picker
location and wants to share?
Manually linking helped me resolve the issue, but don't follow the steps mentioned in the readme.
1. Open application file (android/app/src/main/java/[...]/MainApplication.java) Add `import com.reactnativecommunity.picker.RNCPickerPackage;` to the imports at the top of the file Add `new RNCPickerPackage()` to the list returned by the `getPackages()` method 2. Append the following lines to android/settings.gradle: `include ':@react-native-community_picker' project(':@react-native-community_picker').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/picker/android')` 3. Insert the following lines inside the dependencies block in android/app/build.gradle: `implementation project(':@react-native-community_picker')`
Hope this helps someone! Cheers! š
This resolved the issue for me.
https://github.com/devrdias/react-native-form4u/issues/13#issuecomment-794767488
@lukewlms just replace all the ocurrences of @react-native-community_picker
with @react-native-picker_picker
just install @react-native-picker/picker , it will remove that error automatically
Below steps worked for me
Go to packages/mobile in terminal Install package npm install @react-native-picker/picker --save (or) yarn add @react-native-picker/picker (if you are using yarn) then go back to project root folder restart metro and run android
Hope it will work!
I resolve it by (Manually Linking):
If you see a
Invariant Violation: requireNativeComponent "RNCPicker" was not found in the UIManager
error:React Native users: npm install @react-native-community/picker npx pod-install
Expo: expo install @react-native-community/picker
It works for me!
Works only with:
expo install @react-native-community/picker
THANKS BRO!
I resolve it by (Manually Linking):
- npm install @react-native-picker/picker (if you not installed)
- In MainApplication.java File add "import com.reactnativecommunity.picker.RNCPickerPackage;"
- In MainApplication.java File add "new RNCPickerPackage()" for adding in "getPackages" method.
- In Settings.gradle file add "include ':@react-native-picker_picker' project(':@react-native-picker_picker').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-picker/picker/android')"
- In android/app/build.gradle add "implementation project(':@react-native-picker_picker')"
- npx react-native run-android ;-) I hope useful for you!
Thanks! It worked on my project.
you didn't install @react-native-picker/picker
oh , i managed it myself (i'm not using expo)
how do i get the error "requireNativeComponent ..." :
- i have metro server running and my application running already
- i installing the "this" npm package without stopping my metro or closing my application
- i tried following the example how to use ...
<Picker> ... </Picker>
like so- then it popped up this error
then the way i fixed it :
- i closing my application, i stopped my metro server, cleaning metro cache and also run watchman watch-del-all
- i re run command "npm run android" and let the gradle build my application once again
- let this task done by gradle
- i went to the component where i put the
<Picker> .... </Picker>
and the errors is gone, i can use this package without facing a this error again*this is the way i fixed this issue on "mine" and idk if its different by u guys
cheers~ hope yall fixed the issue soon too
For those who are debugging over WIFI instead of USB, after installing picker package they need to manually remove the old application and then do react-native run-android to install fresh one then all will work. It worked for me.
This happened today to me.
I created a new development build and installed it, and this resolved it.
Dear anyone,
I faced this issue recently. May I know how you all solve this? Thanks in advance for helping me!!
Hello everyone! Caught the same bug today when using
"expo": "~51.0.26",
"@react-native-picker/picker": "^2.7.5",
"react-native-picker-select": "^9.3.1",
Fixed issue by running build application from Android Studio
Bug report
Summary
In expo 38 I get an error: Invariant Violation: requireNativeComponent: "RNCAndroidDialogPicker" was not found in the UIManager
I see at https://github.com/react-native-community/react-native-picker#user-content-for-managed-workflow-users-using-expo-37 that this package is not for expo 37, so I assume that expo 38 is also not supported?
If so, then react-native's
Picker
also doesn't seem to work for me, so I plan to try react-native-picker-select next.Environment info
react-native info
output:Library version: 1.6.6
Steps to reproduce
Picker
from '@react-native-community/picker';<Picker ...><Picker.Item.../></Picker>
in your componentnpx expo start
and connect to expo with an actual Android deviceDescribe what you expected to happen:
Reproducible sample code
https://snack.expo.io/@aproximation/react-native--community-picker-rncandroiddialogpicker-error