[Android] EAS Production Build Looking for Metro Server

Summary

I am running into an error while testing my android production build on Firebase Test Lab. My app builds without errors on eas through the production profile. However, upon uploading this build file to Firebase Test Lab, the tests fail and indicate that the crash was due to Metro not running. Since this is a production build, the app bundle should not depend on a Metro server. My eas.json file is summarized below.

Note: there are no error while running in development mode locally

{ "cli": { "version": ">= 0.46.0" }, "build": { "development": { "distribution": "internal", "android": { "gradleCommand": ":app:assembleDebug" }, "ios": { "buildConfiguration": "Debug", "cocoapods": "1.11.2" } }, "preview": { "distribution": "internal", "ios": { "simulator": true, "cocoapods": "1.11.2" }, "android": { "buildType": "apk", "image": "latest" } }, "production": { "ios": { "image": "latest" }, "android": { "image": "latest" } } }, "submit": { "production": {} } }

Managed or bare?

Bare

Environment

expo-env-info 1.0.3 environment info:
System:
OS: macOS 11.6
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.14.2 - /usr/local/opt/node@16/bin/node
Yarn: 1.22.18 - /usr/local/bin/yarn
npm: 8.5.0 - /usr/local/opt/node@16/bin/npm
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8193401
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
npmPackages:
expo: ^44.0.6 => 44.0.6
react: 17.0.2 => 17.0.2
react-native: 0.67.2 => 0.67.2
npmGlobalPackages:
eas-cli: 0.48.2
expo-cli: 5.3.0
Expo Workflow: bare

Error output

java.lang.RuntimeException: Unable to load script. Make sure you’re either running Metro (run ‘npx react-native start’) or that your bundle ‘index.android.bundle’ is packaged correctly for release.
FATAL EXCEPTION: create_react_context
java.lang.RuntimeException: Unable to load script. Make sure you’re either running Metro (run ‘npx react-native start’) or that your bundle ‘index.android.bundle’ is packaged correctly for release.
at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:248)
at com.facebook.react.bridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:29)
at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:277)
at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1408)
at com.facebook.react.ReactInstanceManager.access$1200(ReactInstanceManager.java:138)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1104)
at java.lang.Thread.run(Thread.java:923)

Reproducible demo or steps to reproduce from a blank project

Step 1: eas build -p android
Step 2: download the .aab file
Step 3: upload the build to Firebase Test Lab / Google Play