Linking only embedded frameworks with another dynamic infrastructure is not performed when building and running on the device

TL; DR

Linking the built-in framework with other frameworks and not linking another structure to your application application required code signature missing when building and running on the device.

Description:

Setup:

My setup is pretty simple (Swift 2.3 and Xcode Xcode 8.0; Build version 8S162m):

  • Using Carthage (0.17.2) I have Other.framework with xcodebuild 8.0 and TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 carthage build --platform iOS
  • MyApp has built in My.framework .
  • Application and framework projects are in the same Xcode workspace.
  • I linked Other.framework to My.framework ONLY (this means that MyApp is not related to Other.framework at all). The fact is that MyApp does not need to use the Other.framework API.

Problem:

Everything seems to be working fine while I'm building and running the application on the device . The running application and process is interrupted by 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 checked the signature of Other.framework and I was fine. Besides,

Solution (workaround)

MyApp link with Other.framework . Awful ... It seems broken.

By linking the same binary Other.framework to MyApp and solving the problem this way, indicates Other.framework is OK and the ability to correctly re-subscribe. Perhaps it has nothing to do with Carthage.

Note: There is a similar issue with the iOS 8+ framework with embedded infrastructure , however, I have a slightly different reason.

+7
ios xcode swift2 xcodebuild ios-frameworks
source share
3 answers

By discussing this issue on the Carthage github page, it becomes clear that the workaround mentioned in the question is actually the β€œstrong” expected behavior

Carthage does not support nested frameworks.

Attachment frames do not allow reuse of these frameworks. For example, if A.framework and B.framework both depend on Other.framework , then none of them can embed Other.framework - otherwise you can have two different versions, and the correct option cannot be selected at runtime.

The correct way to do this is to list it as a dependency, but associate it with the target program.

Full discussion: Linking only the built-in framework with another dynamic infrastructure fails during assembly and launch on the device: "The required code signature is missing"

This was not clear from README, so I raised another issue by asking for documentation to be updated:

Upgrade to README: Linking dynamic frameworks to built-in frameworks also requires linking them with the target program # 1427

This is allowed and closed in the PR area:

# 1427 README upd: dependence of links on built-in frameworks to the target application theme

+1
source share

The problem has nothing to do with nested frames. It is only about checking the correctness of the code. dyld reports that Other.framework is missing code. You need to sign a framework. This should be done for you using Xcode, so I'm curious how the Other.framework assembly is created.

Perhaps you can get around this yourself by simply signing it.

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

or just resign from your application:

 codesign --force --deep --preserve-metadata=identifier,entitlements,resource-rules,requirements,flags,team-identifier --sign - /path/to/My.app 
+2
source share

I fixed my exact problem by following this guide
You do not need to associate your "Other.framework" with your MyApp. Just add a run script to sign any inline framework that lacked code signing

+1
source share

All Articles