App iOS stuck on blank white screen when build release React Native
Categories:
Resolving Blank White Screen on React Native iOS Release Builds

Troubleshoot and fix the common issue of your React Native iOS app displaying a blank white screen when built for release, specifically targeting Xcode 9.2.
Encountering a blank white screen when launching your React Native iOS app in a release build can be a frustrating experience. While development builds often work flawlessly, the release build process introduces optimizations and configurations that can sometimes lead to unexpected issues. This article will guide you through common causes and solutions for this problem, focusing on environments using Xcode 9.2.
Understanding the Release Build Process
When you create a release build for an iOS app, Xcode performs several crucial steps that differ significantly from a debug build. These include minification, obfuscation, and bundling of JavaScript assets. Unlike debug builds which often rely on a development server to serve the JavaScript bundle, release builds embed the JavaScript bundle directly within the app's binary. If this bundling process fails or the app cannot locate the bundled assets, it often results in a blank white screen.
flowchart TD A[Start Release Build] --> B{Bundle JavaScript Assets?} B -->|Yes| C[Embed JS Bundle in App] C --> D[Sign and Archive App] D --> E[App Launched on Device] E --> F{Locate JS Bundle?} F -->|Yes| G[Render React Native App] F -->|No| H[Blank White Screen] B -->|No| H
Simplified flow of React Native iOS release build and potential failure point.
Common Causes and Solutions
The blank white screen issue typically stems from the app's inability to load its JavaScript bundle. This can be due to incorrect build settings, missing files, or issues with the bundling process itself. Let's explore the most frequent culprits and how to address them.
1. Verify JavaScript Bundle Generation
Ensure that the JavaScript bundle is being correctly generated and included in your Xcode project. React Native typically uses a build phase script to create main.jsbundle
.
2. Check Build Phases in Xcode
Open your project in Xcode. Navigate to your target's 'Build Phases'. Look for a 'Bundle React Native code and images' phase. This phase should contain a script similar to the one provided below. Ensure it's enabled and correctly configured.
3. Clean Build Folder and Rebuild
Sometimes, stale build artifacts can cause issues. In Xcode, go to 'Product' -> 'Clean Build Folder'. After cleaning, try archiving your app again ('Product' -> 'Archive').
4. Inspect main.jsbundle
Location
After a successful archive, you can inspect the archived .ipa
file (or the app bundle within the archive) to confirm that main.jsbundle
is present at the root level of your app bundle. If it's missing, the build script is likely failing.
5. Review AppDelegate.m
or AppDelegate.mm
Ensure your AppDelegate
file correctly points to the main.jsbundle
for release builds. The default template usually handles this, but custom configurations can break it.
export NODE_BINARY=node
../node_modules/react-native/scripts/react-native-xcode.sh
Typical 'Bundle React Native code and images' build phase script in Xcode.
// In AppDelegate.m or AppDelegate.mm
#ifdef DEBUG
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
Snippet from AppDelegate showing how jsCodeLocation
is determined for debug vs. release builds.
Advanced Troubleshooting and Xcode 9.2 Specifics
While the core issues remain consistent across Xcode versions, specific configurations or environment setups can introduce unique challenges. For Xcode 9.2, ensure your Node.js and npm versions are compatible with your React Native version. Outdated dependencies can sometimes lead to silent failures during the bundling process.
If the above steps don't resolve the issue, consider the following:

Locating the React Native bundling script in Xcode Build Phases.
Check Info.plist
Ensure there are no conflicting entries or missing permissions that might prevent the app from loading local files. While less common for a blank screen, it's worth a quick check.
Node.js and npm versions
Verify that your Node.js and npm versions are compatible with the React Native version you are using. Mismatches can cause build failures. You can check React Native's documentation for recommended versions.
Third-party Libraries
If you recently added a new third-party library, try temporarily removing it and rebuilding. Some libraries might have native code that isn't correctly linked or configured for release builds.