Thanks for the crash report.
Consider this:
Code Type: X86-64 (Translated)
…
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
On Intel, these SIGILL
crashes are usually the result of a trap, that is, the program has detected a failure and crash itself deliberately. See here. And that’s exactly what’s going on here. Consider the crashing thread backtrace:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libswiftCore.dylib … closure #1 in closure #1 in closure #1 in _assertionFailure(_:_:file:line:flags:) + 315
1 libswiftCore.dylib … closure #1 in closure #1 in _assertionFailure(_:_:file:line:flags:) + 366
2 libswiftCore.dylib … closure #1 in _assertionFailure(_:_:file:line:flags:) + 123
3 libswiftCore.dylib … _assertionFailure(_:_:file:line:flags:) + 230
4 libswiftCore.dylib … Array._checkSubscript(_:wasNativeTypeChecked:) + 129
5 libswiftCore.dylib … Array.subscript.getter + 78
6 TestLicense … closure #1 in closure #1 in testLicenseView.body.getter + 970
7 SwiftUI … 0x7ff91d9dc000 + 18271647
Frame 7 is SwiftUI calling your code in frame 6. That code is indexing into an array (frame 5) which has trapped, almost certainly because the index is out of bounds (frame 4). Frames 3 through 0 are all standard stuff you’ll see in such a trap.
I’m not sure why removing CommonCrypto prevents this crash, but the crash itself has nothing to do with that framework. I recommend that you look at the implementation of testLicenseView
to see why it’s trapping.
Note that the crash report doesn’t include a source file and a line number. For info on how to get that — a process known as symbolication — see Adding identifiable symbol names to a crash report. However, even if you can’t symbolicate it’s likely that the unsymbolicated log contains enough info to debug this.
Finally, some notes:
-
You’re running an Intel build on Apple silicon, which relies on Rosetta. I recommend that you build your app natively. If history repeats itself, Rosetta won’t be around forever.
-
In the Swift API Design Guidelines, type names begin with a capital letter. So testLicenseView
should be TestLicenseView
. This isn’t required by the language, but if you don’t follow the guidelines you’ll confuse anyone else reading your code.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"