1

ios app archived on any arm64, arm7 when installed on a real device crashing after launch. Working fine on Debug and release in simulators. looks like the bundle is not loading.

Steps To Reproduce

npx react-native init testprod --template react-native-template-typescript
open testprod.xcworkspace
build and run
archive
export the ipa
run it reald revice (or use browserstack)

https://drive.google.com/file/d/1le9LaEAD8nODxK0XN0st5UIzqq_dJ3i-/view?usp=sharing

this is the packaged app.

steps to get there;

npx react-native init testprod --template react-native-template-typescript open testprod.xcworkspace archive export the ipa run it reald revice (or use browserstack) there was one bug for linking on the release chain . fixed by following here Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

app crashes with this

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x000000000000000e   x1: 0x0000000000000003   x2: 0x0000000000000028   x3: 0x0000000000000030
    x4: 0x0000000000000603   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000000403
    x8: 0x0000000000000000   x9: 0x0000000000000000  x10: 0xffffffffffffffff  x11: 0x0000000000000000
   x12: 0x000000028135f138  x13: 0x000000000000ffef  x14: 0x0080000000000000  x15: 0x0000004000000001
   x16: 0xffffffffffffffdc  x17: 0x0000000000000001  x18: 0x0000000000000000  x19: 0x0000000281e53420
   x20: 0x0000000281e533e0  x21: 0xffffffffffffffff  x22: 0x0000000000000001  x23: 0x00000001d4693a71
   x24: 0x0000000000000000  x25: 0x00000001d4256b0b  x26: 0x000000002b870064  x27: 0x0000000000000010
   x28: 0x0000000000000000   fp: 0x000000016cf24e10   lr: 0x000000018d02318c
    sp: 0x000000016cf24e00   pc: 0x00000001b7dc6680 cpsr: 0x60000000
   esr: 0x56000080  Address size fault

link to the issue https://github.com/facebook/react-native/issues/30500

Anil Loutombam
  • 355
  • 6
  • 19
Madhu Kumar
  • 395
  • 3
  • 11
  • 1
    can you please try to run `release` mode to your real device first and put the error here? you can go to Product>Scheme>EditScheme change the `Run Build Configuration` to `Release` – Hadi KAR Dec 27 '20 at 17:40

1 Answers1

2

When running on a real device most probably setting a valid development team, development/production certificates and provisioning profile should fix these types of problems.

You can create a valid development team in your Apple Project Account and set it in Xcode->YourProjectTarget->Signing Capabilities.

NOTE: To debug why app crashes on a real device and not on simulator I would try to create an archive and validate it. You should get more info about the problem at the archive or validation process.

Florin Dobre
  • 9,872
  • 3
  • 59
  • 93
  • This is good debugging advice, perhaps, but is it an answer to the question? – matt Dec 24 '20 at 20:56
  • 4
    @matt The second paragraph seems to be an answer. It isn't very clear, true, but it still seems to be an answer. – Bhargav Rao Dec 25 '20 at 04:31
  • Thank you for your comments, I added the debug note at the end of the answer, the initial paragraph order needed indeed an improvement as you said. – Florin Dobre Dec 25 '20 at 11:08
  • seems like RN was taking debug configs while archiving, When the app loaded the bundle was not available and crashed. – Madhu Kumar Dec 28 '20 at 08:18
  • if you want to investigate errors in production build just go to Product. => Scheme => Edit Scheme... Here you have to select Run => Build Configuration set Release (default is debug) and you will be able to catch all errors in release no needed to create ipa file .... btw hi @FlorinDobre – Lukáš Šálek Mar 23 '21 at 09:37
  • @Lukᚊálek thank you for your comment! Hi and all the best! ;) – Florin Dobre Mar 23 '21 at 13:52