Your APK is showing this error on physical device:
"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."
The debug APK you built is missing the JavaScript bundle (index.android.bundle) that contains your app's code.
- Debug builds expect Metro bundler to be running on your computer
- Release builds need JS code bundled inside the APK
- Physical device testing requires bundled JS code
# Make executable and run
chmod +x build-release.sh
./build-release.sh# Step 1: Ensure clean prebuild
npx expo prebuild --platform android --clean
# Step 2: Create assets directory
mkdir -p android/app/src/main/assets
# Step 3: Bundle JavaScript for release
npx react-native bundle \
--platform android \
--dev false \
--entry-file index.ts \
--bundle-output android/app/src/main/assets/index.android.bundle \
--assets-dest android/app/src/main/res
# Step 4: Build release APK
cd android
./gradlew clean
./gradlew assembleRelease
cd ..
# Step 5: Copy APK to builds folder
mkdir -p builds
cp android/app/build/outputs/apk/release/*.apk builds/subtrackr-release.apk- ✅ Bundled JavaScript: All your app code is inside the APK
- ✅ Offline Working: No need for Metro bundler
- ✅ Physical Device Ready: Works on any Android device
- ✅ Hackathon Ready: Professional, distributable APK
📱 Release APK Details:
Name: subtrackr-release.apk
Size: 25-30M
Location: builds/subtrackr-release.apk
Built: 2025-01-14 15:30:45
JS Bundle: 2.1M
- ❌ No JS Bundle: Expects Metro bundler
- ❌ Development Only: Won't work on physical devices
- ❌ Requires Computer: Needs development server running
- ✅ JS Bundle Included: All code packaged inside APK
- ✅ Production Ready: Works on any device
- ✅ Standalone: No external dependencies
- Transfer APK: Copy
builds/subtrackr-release.apkto your device - Enable Unknown Sources: Allow installation from unknown sources
- Install APK: Tap the APK file to install
- Launch App: App should work without any errors
- Installation: APK installs without errors
- Launch: App opens without red box errors
- Navigation: All screens work properly
- Features: Core functionality operates correctly
- Performance: App responds smoothly
- Working APK: Judges can actually test your app
- No Errors: Clean, professional user experience
- Offline Capable: Demonstrates production readiness
- Build System: Shows understanding of React Native builds
- Problem Solving: Demonstrates ability to resolve complex issues
- User Experience: Judges get working app, not error screens
# Check if react-native CLI is available
npx react-native --version
# Install if missing
npm install -g @react-native-community/cli# Check Android build tools
cd android
./gradlew --version
cd ..
# Ensure you have release signing configured
# (For now, use debug signing which should work)# Verify bundle was created
ls -la android/app/src/main/assets/
# Should show: index.android.bundleAfter building the release APK:
- ✅ No More Red Box Errors
- ✅ App Works on Physical Device
- ✅ Ready for Hackathon Submission
- ✅ Professional Quality Demo
./build-release.shnpx expo prebuild --platform android --clean
mkdir -p android/app/src/main/assets
npx react-native bundle --platform android --dev false --entry-file index.ts --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
cd android && ./gradlew assembleRelease && cd ..Your SubTrackr app will work perfectly on physical devices! 🚀📱✨