Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4133 pages
Flutter and app store releases

An Expo app crashes at start because a module's native code is not in the installed build

Your error

Error: Cannot find native module 'ExpoLocation'1 more line it can show

Fix it fast

Most common cause, 1 of 3

A native package was added after the development build was installed

Make a new development build and install it on the device or simulator, then start the dev server again.

Fix
# local
npx expo run:android
npx expo run:ios

# or with EAS
eas build --profile development --platform android
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

The JavaScript side asked expo-modules-core for a native module that the app binary on the device does not contain. That happens when a package with native code was added after the development build was made, when the package is not part of Expo Go, or when its version does not match the SDK. Rebuild the development build, or align versions with npx expo install --fix.

  • Applies to Expo SDK 52 and later, expo-modules-core, React Native 0.76 and later
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Note where the app runs (Expo Go or your own development build) and when that build was made, then ask Expo which installed packages do not match the SDK.

Run this first
npx expo install --check
git log --oneline -5 -- package.json

Then find the line you see in this list and open its fix:

  1. 1A native package was added after the development build was installedThe error started right after npm install or npx expo install of a package such as expo-location or expo-secure-store
  2. 2The app runs in Expo Go, which does not ship that native codeThe project is opened by scanning the QR code in the Expo Go app
  3. 3The package version does not match the installed Expo SDKnpx expo install --check lists the package as needing an update, often after an SDK upgrade or a plain npm install of a newer major

What does the error look like?

  • Error: Cannot find native module 'ExpoLocation'
  • Cannot find native module 'ExpoSecureStore', js engine: hermes

Cause 1 of 3

A native package was added after the development build was installed

You seeThe error started right after npm install or npx expo install of a package such as expo-location or expo-secure-store

Check

Expo's development build guide says that adding a library with native code means rebuilding the development client, because the build on the device was compiled without that code. Reloading JavaScript cannot add it.

Check
git diff HEAD~5 -- package.json | grep '^+'

Fix

Make a new development build and install it on the device or simulator, then start the dev server again.

Fix
# local
npx expo run:android
npx expo run:ios

# or with EAS
eas build --profile development --platform android

Verify

Open the new build, connect to npx expo start, and the screen that used the module loads.

Verify
npx expo start --dev-client

Confirmed by docs.expo.dev

Did this fix it?

Cause 2 of 3

The app runs in Expo Go, which does not ship that native code

You seeThe project is opened by scanning the QR code in the Expo Go app

Check

Expo describes Expo Go as a playground that does not include the native code every library needs. Third-party packages with native code, and some config that a package needs at build time, only work in a development build.

Check
npx expo start   # look at whether the QR opens Expo Go or your build

Fix

Create a development build for the project and use it instead of Expo Go.

Fix
npx expo install expo-dev-client
npx expo run:android   # or npx expo run:ios

Verify

The app opens in your own build (its name and icon, not Expo Go) and the module call works.

Verify
npx expo start --dev-client

Confirmed by docs.expo.dev

Did this fix it?

Cause 3 of 3

The package version does not match the installed Expo SDK

You seenpx expo install --check lists the package as needing an update, often after an SDK upgrade or a plain npm install of a newer major

Check

Each SDK release expects specific versions of the expo-* packages, and the --check flag compares what is installed against that list. A package left on another SDK's version means the JavaScript and the native code in your build came from different releases.

Check
npx expo install --check

Fix

Let Expo set the matching versions, then rebuild if you use a development build.

Fix
npx expo install --fix
npx expo run:android

Verify

--check reports that dependencies are up to date and the app starts.

Verify
npx expo install --check

Confirmed by docs.expo.dev

Did this fix it?

How do I stop it coming back?

  • Rebuild the development client whenever package.json gains a package with native code.
  • Install Expo packages with npx expo install, not plain npm install, so versions match the SDK.
  • Keep Expo Go for quick experiments and use a development build for the real app.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.