Skip to content
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

Invariant Violation: requireNativeComponent: "RNCPicker" was not found in the UIManager. #45

Closed
CaptainJeff opened this issue Jan 9, 2020 · 77 comments

Comments

@CaptainJeff
Copy link

Bug

I am unable to get this to work. I'm receiving the following error

`Violation: requireNativeComponent: "RNCPicker" was not found in the UIManager.

This error is located at:
in RNCPicker (at PickerIOS.ios.js:107)
in RCTView (at View.js:35)
in View (at PickerIOS.ios.js:106)
in PickerIOS (at Picker.js:142)
in Picker (at edit-exercise.modal.tsx:54)
in EditExerciseModal (created by inject-with-exerciseStore(EditExerciseModal))
in inject-with-exerciseStore(EditExerciseModal) (at SceneView.js:9)
in SceneView (at StackViewLayout.tsx:909)
in RCTView (at View.js:35)
in View (at createAnimatedComponent.js:151)
in AnimatedComponent (at StackViewCard.tsx:106)
in RCTView (at View.js:35)
in View (at createAnimatedComponent.js:151)
in AnimatedComponent (at screens.native.js:71)
in Screen (at StackViewCard.tsx:93)
in Card (at createPointerEventsContainer.tsx:95)
in Container (at StackViewLayout.tsx:984)
in RCTView (at View.js:35)
in View (at screens.native.js:101)
in ScreenContainer (at StackViewLayout.tsx:393)
in RCTView (at View.js:35)
in View (at createAnimatedComponent.js:151)
in AnimatedComponent (at StackViewLayout.tsx:383)
in PanGestureHandler (at StackViewLayout.tsx:376)
in StackViewLayout (at withOrientation.js:30)
in withOrientation (at StackView.tsx:104)
in RCTView (at View.js:35)
in View (at Transitioner.tsx:267)
in Transitioner (at StackView.tsx:41)
in StackView (at createNavigator.js:80)
in Navigator (at createKeyboardAwareNavigator.js:12)
in KeyboardAwareNavigator (at SceneView.js:9)
in SceneView (at StackViewLayout.tsx:909)
in RCTView (at View.js:35)
in View (at createAnimatedComponent.js:151)
in AnimatedComponent (at StackViewCard.tsx:106)
in RCTView (at View.js:35)
in View (at createAnimatedComponent.js:151)
in AnimatedComponent (at screens.native.js:71)
in Screen (at StackViewCard.tsx:93)
in Card (at createPointerEventsContainer.tsx:95)
in Container (at StackViewLayout.tsx:984)
in RCTView (at View.js:35)
in View (at screens.native.js:101)
in ScreenContainer (at StackViewLayout.tsx:393)
in RCTView (at View.js:35)
in View (at createAnimatedComponent.js:151)
in AnimatedComponent (at StackViewLayout.tsx:383)
in PanGestureHandler (at StackViewLayout.tsx:376)
in StackViewLayout (at withOrientation.js:30)
in withOrientation (at StackView.tsx:104)
in RCTView (at View.js:35)
in View (at Transitioner.tsx:267)
in Transitioner (at StackView.tsx:41)
in StackView (at createNavigator.js:80)
in Navigator (at createKeyboardAwareNavigator.js:12)
in KeyboardAwareNavigator (at SceneView.js:9)
in SceneView (at SwitchView.js:12)
in SwitchView (at createNavigator.js:80)
in Navigator (at createAppContainer.js:430)
in NavigationContainer (at root-component.tsx:73)
in RCTView (at View.js:35)
in View (at createAnimatedComponent.js:151)
in AnimatedComponent (at react-native-safe-area-view/index.js:163)
in SafeView (at withOrientation.js:54)
in withOrientation (at root-component.tsx:71)
in BackButtonHandler (at root-component.tsx:70)
in MobXProvider (at root-component.tsx:69)
in RootComponent (at renderApplication.js:40)
in RCTView (at View.js:35)
in View (at AppContainer.js:98)
in RCTView (at View.js:35)
in View (at AppContainer.js:115)
in AppContainer (at renderApplication.js:39)`

Environment info

OS: macOS 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 18.22 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash

Binaries:
Node: 12.12.0 - /usr/local/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.6010548
Xcode: 11.2/11B52 - /usr/bin/xcodebuild
npmPackages:
@react-native-community/cli: ^2.9.0 => 2.9.0
react: 16.8.6 => 16.8.6
react-native: 0.60.5 => 0.60.5
npmGlobalPackages:
react-native-cli: 2.0.1

Describe what you expected to happen:

I expected the spinner to show but i received this error. I used the sample code in the readme

@freeworlder
Copy link

Hi,
The same here. It is working on android but on iOS it returns the error.
I am using expo 34.

@jainkuniya
Copy link
Collaborator

Hi, it will be great if you could share some demo project or expo link, where this is reproducible.

@alexhoo
Copy link

alexhoo commented Jan 17, 2020

Same issue here. Expo SDK 36

@flatcoke
Copy link

flatcoke commented Jan 20, 2020

Restart your simulator after pod install

@emmanuel-cbqa
Copy link

Restart your simulator after pod install

Same error.
I tried this and it still doesn't work for me.

@john-harding
Copy link

john-harding commented Feb 18, 2020

Getting this as well. Ejected from expo a month ago.

@cornelRaiu
Copy link

Hi there. Any news regarding this issue?

@Naturalclar
Copy link
Contributor

Picker component is indeed deprecated but still exists in the react-native core repository. Until the picker component is fully removed from the core, usage of react-native-picker on a managed workflow of expo will probably not be supported.

If you are using bare workflow with expo eject, you may need to run pod install to install this package for iOS.

@sebastianknopp
Copy link

Picker component is indeed deprecated but still exists in the react-native core repository. Until the picker component is fully removed from the core, usage of react-native-picker on a managed workflow of expo will probably not be supported.

If you are using bare workflow with expo eject, you may need to run pod install to install this package for iOS.

Any idea when this will happen?

@JiaqiGuo
Copy link

In XCode, in the project navigator, select your project. Add libRNCPicker.a to your project's Build Phases ➜ Link Binary With Libraries
Then Build your project

@freeworlder
Copy link

In XCode, in the project navigator, select your project. Add libRNCPicker.a to your project's Build Phases ➜ Link Binary With Libraries
Then Build your project

I suppose this is for ejected projects. Mine was non-ejected expo project.

@tills98
Copy link

tills98 commented May 6, 2020

Same issue here. Using Expo SDK 37.

@karimcambridge
Copy link

Getting this issue on iPhone XS, Expo SDK 37.

@SixStringsCoder
Copy link

Same here Expo SDK 37

@mutavdzicm
Copy link

Same problem Expo SDK 37

@MorgadoKnivet
Copy link

I solved this deleting the app from simulator and installing again with react-native run-ios

@Mariussuv
Copy link

Not sure this is the case for you, but I imported it using "import {Picker} from '@react-native-community/picker';". And had the same problem for days now. But after changing to "import {Picker} from 'react-native';" it works fine now.

@digaso
Copy link

digaso commented May 13, 2020

Not sure this is the case for you, but I imported it using "import {Picker} from '@react-native-community/picker';". And had the same problem for days now. But after changing to "import {Picker} from 'react-native';" it works fine now.

That's because react-native has their own picker but It is deprecated so they say to use this one

@mritzman-dg
Copy link

Same here with non-ejected app

Expo CLI 3.20.1 environment info:
System:
OS: macOS Mojave 10.14.6
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.1 - /usr/local/bin/node
npm: 6.9.0 - /usr/local/bin/npm
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
expo: ^37.0.0 => 37.0.7
react: 16.9.0 => 16.9.0
react-dom: 16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz => 0.61.4
react-native-web: ^0.11.7 => 0.11.7
npmGlobalPackages:
expo-cli: 3.20.1

@sbirkmyre
Copy link

sbirkmyre commented May 20, 2020

Hi, it will be great if you could share some demo project or expo link, where this is reproducible.

You can have a look at it in my project here. The specific file in question is here.

Let me know if I can provide any other information to help resolve the issue.

@ax0n-pr1me
Copy link

same problem - latest expo.

@Naturalclar
Copy link
Contributor

As far as I know, this component is still not available in the managed workflow of expo 37.
In order to use this component, you would have to eject into a bare workflow, so that other native modules can be used.
If you want to use the Picker Component in managed workflow of expo, please import the Picker component directly from `react-native.

import { Picker } from 'react-native'

you may see a deprecated warning, but the component is still usable as it lives in the core.

@sbirkmyre
Copy link

sbirkmyre commented May 24, 2020

As far as I know, this component is still not available in the managed workflow of expo 37.
In order to use this component, you would have to eject into a bare workflow, so that other native modules can be used.
If you want to use the Picker Component in managed workflow of expo, please import the Picker component directly from `react-native.

import { Picker } from 'react-native'

you may see a deprecated warning, but the component is still usable as it lives in the core.

Thanks for your comment. Will work with the picker directly from React Native. Do you know if/when this component will become available in the managed workflow of Expo 37?

@tometo-dev
Copy link

I too had this issue. This stackoverflow answer solved mine.

@natural411
Copy link

doing a new pod install fixed it for me

@lcruz09
Copy link

lcruz09 commented Jun 18, 2020

Here are some steps that helped on solving it:

  • Make sure you install new pods
  • Uninstall the app on your emulator
  • Clean a build your app again (I did using Xcode)
  • Redeploy your app on the emulator

Hope this helps someone :). Pura vida!

@AhmedAbuelenin
Copy link

The same problem here, hope this gets supported soon for expo users.
Thank you.

@alexhoo
Copy link

alexhoo commented Jul 2, 2020

Expo 38 sdk is out and part of its new features is the Picker
https://blog.expo.io/expo-sdk-38-is-now-available-ab6cd30ca2ee?gi=39cbe20deef6

have you tried this upgrade?

@Mahdisaghroun
Copy link

same problem in Android "RNCAndoidDropdownPicker" was not found in the UI Manager

1 similar comment
@Mahdisaghroun
Copy link

same problem in Android "RNCAndoidDropdownPicker" was not found in the UI Manager

@bachbonglong
Copy link

Restart your simulator after pod install
A wonderful thing happened. It works fine, I don't know why?

@pwaweru
Copy link

pwaweru commented May 5, 2021

Hey I'm still experiencing this problem:
Invariant Violation: requireNativeComponent: "RNCPicker" was not found in the UIManager.

I am not using expo, and running the latest version of React Native (0.64).

I have Picker imported like so:

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

Any ideas?

@youssdevx
Copy link

I am not using expo and I had the same issue.
This is how i fixed it :
cd ios && rm -rf Pods
rm -rf node_modules
yarn && cd ios && pod install && cd ..
yarn add @react-native-picker/picker

Install rn-game-over to clean your React Native project

@sravanpronteff
Copy link

As far as I know, this component is still not available in the managed workflow of expo 37.
In order to use this component, you would have to eject into a bare workflow, so that other native modules can be used.
If you want to use the Picker Component in managed workflow of expo, please import the Picker component directly from `react-native.

import { Picker } from 'react-native'

you may see a deprecated warning, but the component is still usable as it lives in the core.

Thanks for your comment. Will work with the picker directly from React Native. Do you know if/when this component will become available in the managed workflow of Expo 37?

its not working in IOS

@abnwoke
Copy link

abnwoke commented Sep 15, 2021

Please how do I style the picker? my styles are not working.

<Picker
selectedValue={selectedLanguage}
onValueChange={(itemValue, itemIndex) =>
setSelectedLanguage(itemValue)
}
style={{padding: 0, margin: 0}}
mode='dialog' /* dropdown | dialog */
prompt="Categories"

<Picker.Item label="Java" value="java" />

<Picker.Item label="JavaScript" value="js" />

@abnwoke
Copy link

abnwoke commented Sep 15, 2021

Please how do I add a placeholder to the picker?

@JohnMendes
Copy link

Bom dia

fiz assim <Picker.Item style={{color:'#fff'}} label="ENTRADA" value={ENTRADA} />

@DanielAraldi
Copy link

DanielAraldi commented Nov 26, 2021

On RN 66.3 I solved this problem in my project by adding this to my Podfile:

target 'ProjectName' do
  config = use_native_modules!

  # ...
  pod 'RNCPicker', :path => '../node_modules/@react-native-picker/picker'
  # ...
end

@Stephen-L-Wang
Copy link

On RN 66.3 I solved this problem in my project by adding this to my Podfile:

target 'ProjectName' do
  config = use_native_modules!

  # ...
  pod 'RNCPicker', :path => '../node_modules/@react-native-picker/picker'
  # ...
end

Thanks It working

@MorenoMdz
Copy link

Is anybody here experienced in using this library in the new expo custom dev clients? We are getting "RNCPicker" was not found in the UIManager when trying to use the library, it works fine in Expo Go (SDK 44)

@kennyho-ml
Copy link

Is anybody here experienced in using this library in the new expo custom dev clients? We are getting "RNCPicker" was not found in the UIManager when trying to use the library, it works fine in Expo Go (SDK 44)

@MorenoMdz -- Had to use expo update

@MorenoMdz
Copy link

Is anybody here experienced in using this library in the new expo custom dev clients? We are getting "RNCPicker" was not found in the UIManager when trying to use the library, it works fine in Expo Go (SDK 44)

@MorenoMdz -- Had to use expo update

Hey, thanks for the response! What we had to do here was create a new iOS simulator build to use in the dev client.

@Rukt
Copy link

Rukt commented May 16, 2022

What we had to do here was create a new iOS simulator build to use in the dev client.

It was a similar solution for me on Android:

  1. expo install @react-native-picker/picker (2.2.1, per package.json)
  2. eas build --profile development --platform android (where the "development" profile has "developmentClient"; true and "android.buildType": "apk")
  3. adb install "path/to/devBuild.apk" (physical device)
  4. expo start --clear --dev-client

@Saalim95
Copy link

I solved it by:

  1. First, run npm install react-native-picker-select
  2. Then run npm install @react-native-picker/picker
  3. pod install

@shreyvijayvargiya
Copy link

ll @react-native-community/picker

This is deprecated!!!

@janusqa
Copy link

janusqa commented Sep 4, 2023

I had this issue just pop up. I realize that

  1. When using expo go there is no issue as expo go seems to have this installed by default, that is @react-native-picker/picker
  2. If using a dev build I needed to install it manually "npx expo install "@react-native-picker/picker", rebuild the project and that worked.

@Ant1N
Copy link

Ant1N commented Sep 19, 2023

I'm still getting this error as well. I have tried just about all tips in this thread as well. Any new leads on what might be the issue?

@AlexKenny6
Copy link

AlexKenny6 commented Dec 1, 2023

I had this issue too and finally found a solution.

I am running Expo SDK 49 and @react-native-picker/picker v 2.4.10 with a managed Expo workflow.

The picker was working great in Expo Go on iOS simulator and on my physical iPhone. Then was working great when I tested in a staging branch with eas updates. The problem I faced was the app would crash after I clicked on the page that was using the picker in production. After a few hours of tests the solution that I found was to create a new development build with EAS Build. After the build was uploaded to TestFlight, I again tested the Picker and it finally worked.

Hopefully this helps for people and @Ant1N.

@JJSLIoT
Copy link

JJSLIoT commented Jan 30, 2024

This seems to be an issue with 2.6.0+ versions, I rolled back to the 2.5.1 version and the pod issue seems to be resolved.

@ReMuSoMeGA93

This comment was marked as outdated.

@ArunKumar-webdev
Copy link

I solved it by:

  1. First, run npm install react-native-picker-select
  2. Then run npm install @react-native-picker/picker
  3. pod install

thanks this works.

@Naturalclar
Copy link
Contributor

For expo projects, please run
expo install @react-native-picker/picker

For bare projects, please run
npm install @react-native-picker/picker
then run
pod install
for iOS projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests