Invariant Violation: requireNativeComponent: "RNCAndroidDialogPicker" was not found in the UIManager

See original GitHub issue

Bug report

Summary

In expo 38 I get an error: Invariant Violation: requireNativeComponent: “RNCAndroidDialogPicker” was not found in the UIManager

"expo": "^38.0.0"
"react": "16.11.0"
"@react-native-community/picker": "^1.6.6"

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:

System:
    OS: Linux 4.4 Ubuntu 14.04.6 LTS, Trusty Tahr
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 20.45 GB / 31.93 GB
    Shell: 4.3.11 - /bin/bash
  Binaries:
    Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
    Yarn: Not Found
    npm: 6.14.8 - ~/.nvm/versions/node/v12.16.1/bin/npm
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: 11.0.5 - /usr/bin/javac
    Python: 2.7.6 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: ^4.12.0 => 4.12.0
    react: 16.11.0 => 16.11.0
    react-native: 0.62.2 => 0.62.2
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 1.6.6

Steps to reproduce

  1. Import Picker from ‘@react-native-community/picker’;
  2. use <Picker ...><Picker.Item.../></Picker> in your component
  3. run npx expo start and connect to expo with an actual Android device

Describe what you expected to happen:

  1. I should see my component with picker
  2. I should be able to tap on the picker and select an option

Reproducible sample code

https://snack.expo.io/@aproximation/react-native--community-picker-rncandroiddialogpicker-error

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:29
  • Comments:43

github_iconTop GitHub Comments

42reactions
SurajMDurgadcommented, Oct 8, 2020

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! 🎉

41reactions
arvindellcommented, Sep 25, 2020

This is happening as well on RN 0.63, without expo

Read more comments on GitHub >

github_iconTop Results From Across the Web

RNCAndroidDropdownPicker was not found in the UIManager
I have installed nativebase version 2.15.2. I am getting following error in android: requireNativeComponent "RNCAndroidDropdownPicker ...
Read more >
requireNativeComponent: "RNCAndroidDialogPicker" was not ...
invariant violation: requirenativecomponent: "rncandroiddialogpicker" was not found in the uimanager. Add Answer | View In TPC Matrix.
Read more >
How to use react-native-picker-select - LogRocket Blog
requireNativeComponent "RNCPicker" was not found in the UIManager error. You can resolve this error by running: // React Native CLI npm ...
Read more >
RNCAndroidDialogPicker" was not found in the UIManager ...
RNCAndroidDialogPicker" was not found in the UIManager after upgrade to nativebase 2.13.15.
Read more >
ERROR Invariant Violation: requireNativeComponent ...
ERROR Invariant Violation: requireNativeComponent: “RNSScreenStackHeaderConfig” was not found in the UIManager. In React Native… Photo by Luca Nicoletti on ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found