Linking embedded framework with other dynamic framework fails when build & run on device

(Offtop: Looking through other similar questions with zero to one answers, I don't believe in miraccle, that someone would answer me, but still think it worth trying)


My setup is pretty simple (Swift 2.3 & Xcode 8B2):


- Using Carthage I have build Other.framework

- MyApp has embeded My.framework framework.

- The app and framework projects are under one Xcode workspace.

- I hade linked Other.framework to My.framework ONLY (that means, MyApp is not linked to Other.framework at all). The point here is that, MyApp does not need to use Other.framework API.

Here is the problem:

Everything seems to work fine, until I Build & Run the app on the device. The app launched and than the process is aborted with the following Xcode error:

dyld: Library not loaded: @rpath/Other.framework/Other
  Referenced from: /private/var/containers/Bundle/Application/DCF0331F-FF23-43CF-AE79-B3857D5A6EE3/MyApp.app/Frameworks/My.framework/My
  Reason: no suitable image found.  Did find:
  /private/var/containers/Bundle/Application/DCF0331F-FF23-43CF-AE79-B3857D5A6EE3/MyApp.app/Frameworks/My.framework/Frameworks/Other.framework/Other: required code signature missing for '/private/var/containers/Bundle/Application/DCF0331F-FF23-43CF-AE79-B3857D5A6EE3/MyApp.app/Frameworks/My.framework/Frameworks/Other.framework/Other'


I have checked the signature of Other.framework and it looked OK to me. Moreover,


The Workaround:


Link MyApp with Other.framework. Horrible. This feels broken.

Linking the very same binary Other.framework to MyApp and solving the issue this way, points out, the Other.framework is built OK and able to be re-signed correctly.

Replies

I am experiencing the same issue with Xcode Version 8.0 (8A218a), having turned on the 'automatically manage signing' feature.

Regarding the workaround - I noticed that it is sufficient to only embed Other.framework in the host target (MyApp). Linking does not seem to be necessary.It's only the 'embed' part that does the signing correctly.

Please see this issue: https://github.com/Carthage/Carthage/issues/1401

Based on the log message, it appears that Other.framework is not codesigned. How was it created? It needs to be signed. You can probably workaround this by signing it manually yourself for now, but you should provide more detail about how it's getting built because it should be signed automatically.


codesign --force --deep --preserve-metadata=identifier,entitlements,resource-rules,requirements,flags,team-identifier --sign - /path/to/Other.framework

anyone who still facing this issue, please see conversation at github (as @playabilityas suggested above).

https://github.com/Carthage/Carthage/issues/1401#issuecomment-393899619