React Native & Expo errors · Error 03 of 12

Native module not found / “Native module cannot be null” in Expo

By Muhammad Abdullah, full-stack, mobile and ai automation developer · Last reviewed

Invariant Violation: TurboModuleRegistry.getEnforcing(...): '<Module>' could not be found

Short answer

The library you installed contains custom native code that is not inside Expo Go or your current build. Create a development build that includes the native code, and rebuild every time you add a native library.

Common causes

  • Running a library with native code (for example some payment, Bluetooth or video libraries) inside Expo Go.
  • A native library was added after the last development build, so the installed app does not contain it.
  • The library needs an Expo config plugin that has not been added to app.json / app.config.js.

How to fix it

  1. Install the development client:

                          npx expo install expo-dev-client
                        
  2. Add the library’s config plugin to the plugins array in your app config, if its docs require one.

  3. Build and install a development build (cloud or local):

                          eas build --profile development --platform android
    # or locally
    npx expo run:android
                        
  4. Start the bundler for the dev build and open the app from it (not from Expo Go):

                          npx expo start --dev-client
                        

Similar messages include “requireNativeComponent: '<Name>' was not found in the UIManager” and “<Module> native module cannot be null”.

Let’s talk about the next step

Have an idea, a stuck app, or a workflow toimprove?

Tell me what you are building, what is blocking you, and what a successful outcome looks like.