Skip to content

React Native Android errorReact Native: “Unable to load script. Make sure you’re either running Metro…”

The app opens to a red screen that starts Unable to load script. Make sure you’re either running Metro. In development, the app can’t reach the Metro server on your computer. In a build sent to a tester or a client, the JavaScript was never packed into the app: a debug APK needs Metro, and a release build needs the bundle step. That case needs a build fix, not a running server. Here are both, in React Native’s words, or hand it over at a fixed price.

Short answer

On a release APK or AAB, the JavaScript bundle is missing: build with cd android && ./gradlew bundleRelease (AAB) or ./gradlew assembleRelease (APK), and remove org.gradle.configureondemand=true from gradle.properties if it is there, because it skips bundling. In development, start Metro with npx react-native start, then connect the device with adb reverse tcp:8081 tcp:8081, or set your computer’s IP and port 8081 in the dev settings.

Which build you’re on decides the fix

  1. 01

    A release build without the JavaScript bundle

    “This command uses Gradle's bundleRelease under the hood that bundles all the JavaScript needed to run your app into the AAB (Android App Bundle).” React Native, Publishing to Google Play Store

    A release build must carry its JavaScript inside the app. If a tester or client sees this screen, the bundle step didn’t run. Build with ./gradlew bundleRelease or ./gradlew assembleRelease from the android folder, and check that android/app/build.gradle still points at your index file.

  2. 02

    A Gradle setting skips the bundle

    “Make sure gradle.properties does not include org.gradle.configureondemand=true as that will make the release build skip bundling JS and assets into the app binary.” React Native, Publishing to Google Play Store

    Open android/gradle.properties and remove the line if it is there, then build again.

    org.gradle.configureondemand=true
  3. 03

    A debug build that can’t reach Metro

    “You can also iterate quickly on a device by connecting to the development server running on your development machine.” React Native, Running On Device

    Debug builds load JavaScript from Metro on your computer. Start it, then forward the port over USB.

    npx react-native start
    adb reverse tcp:8081 tcp:8081
  4. 04

    Over Wi-Fi, the app points at the wrong address

    “Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081).” React Native, Running On Device

    Without a cable, open the dev menu and set the debug server host to your computer’s IP address and port 8081. The phone and computer must be on the same network.

Checked against the vendor’s docs on : React Native docs: Publishing to Google Play Store; React Native docs: Running on device.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

Related: Expo app crashes in production · Android blocks http:// requests · Google Play App Bundle signed with the wrong key

Questions

More on this error

Does a release build need Metro running?

No. React Native says you can stop any running bundler, because the framework and JavaScript code are bundled in the APK’s assets. If a release build asks for Metro, the bundle is missing.

I use Expo. Does this apply?

The same split applies: development builds load from the dev server, release builds carry their own bundle. Build release versions with EAS Build or your release command, not a debug build.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; we reply by email, usually within one business day.