MobileGeek
MobileGeek

Reputation: 2512

Invariant Violation: Picker has been removed from React Native

enter image description here

ERROR Invariant Violation: Picker has been removed from React Native. It can now be installed and imported from '@react-native-picker/picker' instead of 'react-native'.
See https://github.com/react-native-picker/picker
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.

I'm trying to configure an existing react-native project, but I'm facing the above issue with it.

I do not have picker in the project while it is showing following error. Added @react-native-picker/picker as well.

Upvotes: 5

Views: 2956

Answers (3)

o M a R
o M a R

Reputation: 21

1.Install patch-package into your project,

Install @react-native-picker/picker into your project,

go to node_modules\react-native\index.js

replace all

invariant(
      false,
     'DatePickerAndroid has been removed from React Native. ' +
       "It can now be installed and imported from '@react-native- 
     community/datetimepicker' instead of 'react-native'. " +
       'See https://github.com/react-native- 
   datetimepicker/datetimepicker',
      );

or

invariant(
             false,
          ........ DatePicker ..........
             );

to

return require('@react-native-picker/picker') 

run

npx patch-package react-native

rebuild your app and it will be work

Upvotes: 2

Jailton Oliveira
Jailton Oliveira

Reputation: 11

It was released a fix in the version 2.15.2 of native-base.

history:
https://github.com/GeekyAnts/NativeBase/pull/3230 https://github.com/GeekyAnts/NativeBase/releases/tag/v2.15.2

Upvotes: 1

Sathish Saminathan
Sathish Saminathan

Reputation: 688

In My case I removed @davidgovea/react-native-wheel-datepicker this package which uses old dependencies which caused the issue.

Upvotes: 1

Related Questions