Mendis
Mendis

Reputation: 83

Invariant Violation: TurboModuleRegistry.getEnforcing 'RNCDatePicker' could not be found. Verify that a module by this name is registered

While trying to use "DateTimePicker" from '@react-native-community/datetimepicker', am getting the below error.

ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNCDatePicker' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes ERROR Invariant Violation: "main" has not been registered. This can happen if:

You can find the project here https://github.com/mendismenon/md_reactnative.

I was follwing the below video to implement this feature. https://www.youtube.com/watch?v=UEfFjfW7Zes

Upvotes: 7

Views: 13316

Answers (4)

Maanli yass
Maanli yass

Reputation: 231

Check your terminal, where you run expo start ! You should see a warning about the version compatiblility of your expo and your @react-native-community/datetimepicker

(in the exemple below the current version that cause the issue is 8.3.0 and the good one is 8.2.0)

. Then install the right version of your @react-native-community/datetimepicker (here I runned npm install @react-native-community/[email protected]). It worked for me !! enter image description here

Upvotes: 1

Richard Tai
Richard Tai

Reputation: 498

The datetimepicker lib must be wrapped in the .apk even though the code runs in development mode.

eas build --profile development --platform android

Upvotes: 1

Combine
Combine

Reputation: 4224

Thanks to the answered comments so far - I was able to fix this error also.

When I was starting the project I got this warning:

...
Starting Metro Bundler
Some dependencies are incompatible with the installed expo version:
  [email protected] - expected version: 13.9.0
  @react-native-community/[email protected] - expected version: 7.2.0
  @react-native-async-storage/[email protected] - expected version: 1.18.2
Your project may not work correctly until you install the correct versions of the packages.
Fix with: npx expo install --fix

As the people suggested I modified my package.json like this:

  "dependencies": {
    "expo": "~49.0.15",
    ....
    "@react-native-community/datetimepicker": "7.2.0",
    "@react-native-async-storage/async-storage": "1.18.2"
  },

Basically what I did is to downgrade the versions of datetimepicker and async-storage to match the versions from the warning message.

Then I ran:

npx expo install --fix 
npm install 

And this fixed my issue. Good luck!

Upvotes: 1

David Leuliette
David Leuliette

Reputation: 1959

I think I found the issue

It is related to android only phone,

You can fix it by downgrading temporary expo

npm install expo@^48.0.0

and then

npx expo install --fix 

Upvotes: 3

Related Questions