Expo App Crashes on Launch in Production, Fine in Dev

Your Expo or React Native app runs fine in development but crashes on launch from TestFlight or Google Play? Reproduce the release build, read the native crash log, and fix the five usual causes.

An Expo app that crashes on launch in production but not in development is almost always hitting something that only exists in a release build: a missing environment variable, a missing native module or permission string, code stripped by minification, or a backend call that fails and is not handled. Run the app in release mode on a real device, read the native crash log (not the JavaScript console), and the crashing line usually names the cause.

In development, Metro serves your code with warnings, red screens and a forgiving runtime. A release build runs a minified Hermes bytecode bundle, with your production settings and no dev server. Different code paths run. This guide shows how to get the real crash, then the causes in the order they are most often the answer.

Step 1: Reproduce the Release Build on Your Machine

Do not debug by uploading a new build to TestFlight each time. That takes 20 minutes per try. Run a release build locally:

# Android
npx expo run:android --variant release

# iOS
npx expo run:ios --configuration Release

If you do not want a full native build yet, run the JavaScript in production mode first:

npx expo start --no-dev --minify

This turns off dev mode and minifies the bundle. Developers on the Expo forum report that it does not always reproduce the crash, because it still uses a dev client and your local .env. Treat a clean result as "not a minification bug", not as "the app is fine". Move on to the release build. A forum thread on a TestFlight-only crash shows exactly this case.

Step 2: Read the Native Crash Log

A JavaScript error shows up in the Metro terminal. A launch crash in a release build often never reaches JavaScript, so you will see nothing there. Read the native log instead.

Android:

adb logcat -b crash
# or, for a wider view while you open the app
adb logcat *:E | grep -i -E "ReactNative|AndroidRuntime|FATAL"

Look for FATAL EXCEPTION and the lines under it. A java.lang.UnsatisfiedLinkError or ClassNotFoundException points to a native module problem. A JavascriptException points to your own code.

iOS: connect the device, open Xcode, then Window > Devices and Simulators > your device > View Device Logs. For TestFlight builds, Xcode Organizer > Crashes lists crash reports from testers. Look at the "Exception Type" and the first frames of the crashed thread. Apple Developer Forums threads such as App Crashes on TestFlight but Works in Simulator (Expo React Native App) show that the log, not the simulator, is where the answer is.

On Google Play, the Android vitals page in Play Console groups crashes by version. Use it when you cannot attach a cable to the affected phone.

Step 3: Check Environment Variables

This is the most common cause of a crash that only happens in cloud builds. Expo only inlines variables that start with EXPO_PUBLIC_, and it reads them at build time. Your local .env file is usually in .gitignore, so an EAS cloud build never sees it. The result is undefined where your code expects a URL or an API key, and a line such as new URL(process.env.EXPO_PUBLIC_API_URL) throws on launch.

Check what the production build actually has:

eas env:list --environment production

Create anything missing and make sure the build profile uses that environment:

eas env:create --environment production --name EXPO_PUBLIC_API_URL --value https://api.example.com --visibility plaintext
{
  "build": {
    "production": {
      "environment": "production"
    }
  }
}

Then add a guard so a missing variable fails with a clear message instead of a crash:

const API_URL = process.env.EXPO_PUBLIC_API_URL;
if (!API_URL) {
  throw new Error("EXPO_PUBLIC_API_URL is missing in this build");
}

Expo's environment variables guide explains the prefix rule and the environment field. The same trap exists on the web, which we cover in Next.js environment variables undefined in production.

Step 4: Check Native Modules, Permissions and Config

Expo Go ships with a fixed set of native modules. A development build or release build only has what you installed and configured. Three things break here:

  • A native library added after the last native build. Installing a package with native code needs a new build. An OTA update cannot add it.
  • A missing iOS usage string. If your code touches the camera, location, photos or microphone and the matching Info.plist description is missing, iOS terminates the app at that call. Set it in app.json:
{
  "expo": {
    "ios": {
      "infoPlist": {
        "NSCameraUsageDescription": "We use the camera to scan receipts."
      }
    }
  }
}
  • A config plugin that is not listed. Many libraries need an entry in the plugins array of app.json. If it is missing, the module is not linked and the first call crashes.

One forum report traced a TestFlight-only crash to a single library, aws-amplify, found by removing recent dependencies one at a time. If the crash log does not name the culprit, bisect your last few installs the same way.

Step 5: Check Minification and Code Shrinking

Release builds shrink code. On Android, R8 can remove classes that a library loads by name at runtime, which gives ClassNotFoundException only in release. Confirm by turning shrinking off for one test build using the expo-build-properties plugin:

{
  "expo": {
    "plugins": [
      ["expo-build-properties", { "android": { "enableProguardInReleaseBuilds": false } }]
    ]
  }
}

If the crash disappears, put the library's keep rules back instead of leaving shrinking off. The library README usually lists them.

Step 6: Handle Failing API Calls

A release build talks to your production backend, not the laptop server you used in development. Two things change:

  • Plain http:// URLs. Android 9 and later and iOS block cleartext traffic in release builds by default. A call that worked against http://192.168.1.5:3000 fails against an http:// staging URL. Use HTTPS.
  • Unexpected responses. A 401, a 500 or an empty body gives you undefined in code that assumed data. data.user.name then throws, and an unhandled throw in the wrong place ends the app.

Wrap startup calls and handle the failure case:

try {
  const res = await fetch(`${API_URL}/me`);
  if (!res.ok) throw new Error(`GET /me failed: ${res.status}`);
  setUser(await res.json());
} catch (err) {
  console.warn(err);
  setUser(null); // show the signed-out screen, do not crash
}

Also add an error boundary near the root so a render error shows a fallback screen. Our React error boundary guide covers the pattern. It works the same in React Native.

Step 7: Make the Next Crash Readable

Even after you fix this crash, the next one will arrive as a stack of minified names. The React Native docs on debugging release builds explain why. Hermes frames look like p@1:132161, a minified function name and a bytecode offset, and you need the source map from the exact build that crashed to turn them back into file and line numbers. On Android, source maps are produced for release builds by default. On iOS they are off until you set SOURCEMAP_FILE in the "Bundle React Native code and images" build phase. With the map in hand, pipe a crash stack through metro-symbolicate:

adb logcat -d | npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map

Keep the map for every release you ship. A map from a different commit gives wrong lines.

How Relia Helps

Relia records sessions, screens, taps, API calls and crashes in your React Native or Expo app, tagged with the app version and release. Release builds upload their symbols, so crash stacks are readable without manual symbolication. A crash or a failing call in the app is joined to the backend request behind it. If a backend change breaks only one version of the app, the incident shows both sides and who was affected. Setup: run npx relia-sdk@latest init in your app folder, and follow the React Native setup guide. See how to find production bugs before users report them for the wider approach.

FAQ

Why does my Expo app work in Expo Go but crash in the production build?

Expo Go includes a fixed set of native modules and your local .env. A production build only contains what you installed, configured and set as EAS environment variables. Check the native crash log, then variables, plugins and permissions.

How do I see the crash log of an app that crashes right on launch?

On Android use adb logcat -b crash. On iOS use Xcode's Devices and Simulators window, or Xcode Organizer for TestFlight crashes. The JavaScript console shows nothing when the crash happens before JavaScript runs.

Why does the crash only happen on TestFlight and not in the simulator?

TestFlight builds are release builds on real hardware, with production environment values and your App Store signing and entitlements. Reproduce it with npx expo run:ios --configuration Release --device.

Can an over-the-air update crash my app on launch?

Yes. An update that needs a native module the installed build does not have will fail at startup. Only ship updates to builds whose native code matches.

All guides