Illegal Instruction 4 Error When Running Outside of Xcode

I am trying to troubleshoot an issue that surfaced recently that I am having difficulty fixing as it is only happening on the exported (Archived) releases of my app. Error in crash log is Namespace SIGNAL, code 4, Illegal Instruction 4 My project uses a cocoapod to work with hardware devices and this error happens only for specific device and only on client machines. For testing, my Xcode dev machine and my test machine are both Macbook Pros running 12.6. Before testing, I delete the old app completely, remove any privacy entries, and preferences files, caches etc. When I first install the app (No installer, just coping .app file), the app launches and it doesn't throw the error and works. If I close the app and reopen, as soon as I try to use the device, app crashes. I use a different hardware device and there are no issues. I tested on another client as well with the same hardware and same issue. The thing that makes this difficult is that I can run it in debug mode from XCode with no issues. I did some research but everything I've seen seems to be about this happening on app launch but that's not happening here. Plus, it works first time app launches but on subsequent launches, as soon as I use the hardware device it crashes. Looking at the crash log, the crash happens as soon as it receives the data from the HID device. But again, different hardware model doesn't crash, on my dev machine, doesn't crash. Also, if I run the app on my dev machine as a standalone, it doesn't crash either. I'm hoping something can provide me with some troubleshooting or debug ideas to help me isolate this issue. I've never had this type or crash not reproducible on a client machine so the extent of my troubleshooting that way is limited to crash dumps. I drive removing all DerivedData as I found on StackOverflow and that actually made the app run twice. Then crashed.

Illegal Instruction 4 Error When Running Outside of Xcode
 
 
Q