One of my colleagues got a strange error when trying to run our iOS application on an iPad:
12345
dyld: Library not loaded: @rpath/CocoaLumberjack.framework/CocoaLumberjack
Referenced from: /var/containers/Bundle/Application/UUID/Incredible.app/Incredible
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/UUID/Incredible.app/Frameworks/CocoaLumberjack.framework/CocoaLumberjack: code signing blocked mmap() of '/private/var/containers/Bundle/Application/UUID/Incredible.app/Frameworks/CocoaLumberjack.framework/CocoaLumberjack'
…
I thought it was a pretty strange error because the app loaded fine, but the required dynamic frameworks did not due to a code signing error. There was a warning at the signing step in the project, but I didn’t record it.
Long story short. Turned out that the iPhone Developer certificate was marked as “Always Trust” in the “Keychain Access.app”, which didn’t seem right. I changed it back to “Use System Defaults” (see the screenshot), ran the app… and got the same crash. That’s because I needed to clean and rebuild the .app first and reinstall the app on the device.
(Apparently, Xcode doesn’t check the validity of the certificate in that case, or maybe just inserts it as is with the custom trust settings into the app, and iOS doesn’t like that at all.)
On the screenshot, it says “This certificate is marked as trusted for this account”, and I changed “When using this certificate:” to “Use System Defaults”: