Archived builds crash on device
See original GitHub issue[N.B.: Apologies for the length, but this smells like there’s a critical undocumented step, so I’m trying to be fully detailed here. – J]
Repro steps
Get the sample repo and set it up
git clone https://github.com/jwhitley/ReactNativeTesting.git/
cd ReactNativeTesting
git co realm-redbox
(jwhitley/ReactNativeTesting@d252d5b at this writing)npm install
Launch Xcode and build the project archive
open ios/ReactNativeTesting.xcodeproj
- In Xcode: Project > Archive
- In Xcode: Window > Organizer
- With the archive just built selected in the organizer, click “Export…” in the right-hand pane.
- In the export UI, choose “Save for Development Deployment” then hit “Next”
- Choose a valid provisioning team and confirm.
- Choose “Export one app for all compatible devices” then hit “Next”
- Hit “Next” on the Summary pane to build the archive, then choose a place to save it.
Install the archive on device
- In Xcode, open Window > Devices and select a target device
- Drag the newly built
.ipa
file onto the “Installed Apps” pane - On the device, launch the app.
Expected results
This “app”, mostly just the base template generated by RN plus realm-js
integration, loads and runs.
Actual results
Redbox with Missing Realm constructor [...]
error message appears.
Notes
This project has all of these settings from #311 applied:
- Strip Debug Symbols During Copy: No
- Strip Linked Product: No
- Dead Code Stripping: No
The Archive scheme has been switched to Debug in this project so that a redbox will appear on the device instead of the app simply crashing and keeping its secrets to itself. (EDIT: This is merely a convenience; the same error is emitted in the device logs in a normal Archive (Release) build.)
ReactNative’s template-generated AppDelegate.m
in this project has been switched to use the packaged build instead of the development server.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
@jwhitley Thanks so much for the detailed repro steps! @esutton seems to be right that something changed with Xcode 7.3. It looks like the strip settings are not honored when you build with bitcode enabled. So the temporary workaround is to also set
Enable Bitcode
toNo
.I am prioritizing getting this to work without all of the special Xcode settings. Thank you again for this report!
@jwhitley @esutton Check out the 0.11.0 Release Notes for how to upgrade your project. Like @alazier said, you can revert your strip and bitcode settings to the defaults after upgrading.