I'm working on an iOS project with a moderately complex build system that creates a framework/universal binary.
While making some changes to that framework & it's test app, running it suddenly started crashing in dyld before hitting main(). It appears to be an issue with Xcode, as reverting the build and even downloading a known good version now produce the same result! Dyld is failing to load the custom framework:
Process: TestApp [530]
OS Version: iOS 9.2.1 (13D15)
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000000e7ffdefe
Triggered by Thread: 0
Dyld Error Message:
Dyld Message: Library not loaded: @rpath/Test.framework/Spin
Referenced from: /var/mobile/Containers/Bundle/Application/8A7C50D3-F3A1-4DB6-8929-52607F8605A2/TestApp.app/TestApp
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/8A7C50D3-F3A1-4DB6-8929-52607F8605A2/TestApp.app/Frameworks/Test.framework/Test
mmap() errno=1 validating first page of
'/private/var/mobile/Containers/Bundle/Application/8A7C50D3-F3A1-4DB6-8929-52607F8605A2/TestApp.app/Frameworks/Test.framework/Test'
Error Formulating Crash Report:
Failed while requesting activity/breadcrumb diagnostics
This problem appears to have numerous possible root causes. I've tried the various solutions posted for question 32730312 (here: Reason: no suitable image found.) including:
- deleting the projects Build and DerivedData folder
- deleting various Xcode cache folders
- restarting xcode, the computer & even the devices
- regenerating the provisioning profile
- discarding the project and building from a fresh pull or even previous releases of the SDK
None of those remedied the problem.
The project runs fine on the simulator, but not on a device. I'm unsure what else to try short of reinstalling Xcode and/or creating a separate user account as there's apparently something else blown apart in Xcode that I've missed!