question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

  1. git clone https://github.com/jwhitley/ReactNativeTesting.git/
  2. cd ReactNativeTesting
  3. git co realm-redbox (jwhitley/ReactNativeTesting@d252d5b at this writing)
  4. npm install

Launch Xcode and build the project archive

  1. open ios/ReactNativeTesting.xcodeproj
  2. In Xcode: Project > Archive
  3. In Xcode: Window > Organizer
  4. With the archive just built selected in the organizer, click “Export…” in the right-hand pane.
  5. In the export UI, choose “Save for Development Deployment” then hit “Next”
  6. Choose a valid provisioning team and confirm.
  7. Choose “Export one app for all compatible devices” then hit “Next”
  8. Hit “Next” on the Summary pane to build the archive, then choose a place to save it.

Install the archive on device

  1. In Xcode, open Window > Devices and select a target device
  2. Drag the newly built .ipa file onto the “Installed Apps” pane
  3. 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:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
appdencommented, Mar 22, 2016

@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 to No.

I am prioritizing getting this to work without all of the special Xcode settings. Thank you again for this report!

0reactions
appdencommented, Mar 24, 2016

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode 13.2 Archived App Crashes on iOS 14 - Apple Developer
App runs successfully in Xcode in simulator and on device, but crashes on iOS 14 when archived and installed either ad hoc or...
Read more >
4.3.2: Crash on launch in archived IPA app (#49) - gitter - GitLab
Debug builds do not crash on launch. Related to. ... Install the generated IPA using Devices and Simulators; Start the app. Expected Result:....
Read more >
Crash when trying to "archive" an android application
When i try to archive an android application which builds fine, an error is displayed. See full log attached. Preview: Xamarin.VisualStudio.Progress.
Read more >
iOS App with Static Lib crashes ONLY on launch of Archive ...
I recently came across a case similar to this when building my GPUImage framework. It appears that the build process is slightly different...
Read more >
[Solved]-iOS App crashes in Archive Build but not Release/Run
So that when I was running the simulator and testing on my device it was not detecting a released object. But when I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found