Skip to content

Instantly share code, notes, and snippets.

@pavel-zdenek
Last active November 5, 2016 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavel-zdenek/9c75f8f7860e9f1c8b8ad856a6a957a0 to your computer and use it in GitHub Desktop.
Save pavel-zdenek/9c75f8f7860e9f1c8b8ad856a6a957a0 to your computer and use it in GitHub Desktop.
Xcode8 on Circle insists on Pod signing

Last known good Xcode 7.3

https://circleci.com/gh/kitt-browser/adblockplus-ios/1137#

Mind the lack of codesign commands in log

If config left as original

Signing Identity:     "-"
/usr/bin/codesign --force --sign - --timestamp=none

But does not seem to be a problem (is not in local simulator run at least)

BUT then the linker says

https://circleci.com/gh/kitt-browser/adblockplus-ios/1166

dyld: Library not loaded: ….AttributedMarkdown
  Referenced from: ….AdblockBrowser.app/AdblockBrowser
  Reason: no suitable image found.  Did find:
    ….AttributedMarkdown.framework/AttributedMarkdown: required code signature missing for ‘….AttributedMarkdown.framework/AttributedMarkdown'

Where AttributedMarkdown is the first Pod in Podfile and in alphabet.

Bigger hammer to avoid signing

CODE_SIGNING_REQUIRED=NO is not enough

CODE_SIGNING_ALLOWED=NO is necessary

https://circleci.com/gh/kitt-browser/adblockplus-ios/1168

No change, still "required code signature missing"

Mind that Podfile already says

config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
config.build_settings['SWIFT_VERSION'] = "2.3"

Carthage knowledge suggests that this is caused by embedded frameworks (e.g. AttributedMarkdown inside Pods).

https://forums.developer.apple.com/thread/52593

Carthage/Carthage#1401

http://stackoverflow.com/questions/38527565/linking-only-embedded-framework-with-other-dynamic-framework-fails-when-build

and recommends linking the embedded frameworks directly with the app instead of through Pods.

CocoaPods itself just shrug and mumble about system reinstallation

http://stackoverflow.com/questions/30053144/dyld-library-not-loaded-with-cocoapods-0-37-and-xcode-6-3/30166310#30166310

So when linking with AttributedMarkdown directly

https://circleci.com/gh/kitt-browser/adblockplus-ios/1167

No change, still "required code signature missing"

Also tried "embedded binary" per some distilled wisdom

https://circleci.com/gh/kitt-browser/adblockplus-ios/1169

PBXCp iphonesimulator10.0/Debug-iphonesimulator/AttributedMarkdown.framework iphonesimulator10.0/Debug-iphonesimulator/AdblockBrowser.app/Frameworks/AttributedMarkdown.framework
error: /Users/distiller/adblockplus-ios/iphonesimulator10.0/Debug-iphonesimulator/AttributedMarkdown.framework: No such file or directory

Apparently being looked up in wrong location

Cannot use Swift3 versions of Pods, because

The `AdblockBrowser [Release]` target overrides the `SWIFT_VERSION` build setting defined in `Pods/Target Support Files/Pods-AdblockBrowser/Pods-AdblockBrowser.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

My understanding is that Pods xcconfig prohibits downgrading Swift version in the embedding app.

This may be solved by migrating to Carthage

@jeremyhu
Copy link

jeremyhu commented Nov 5, 2016

CODE_SIGNING_REQUIRED and CODE_SIGNING_ALLOWED are Xcode build settings. They control how Xcode builds your project. I suggest you not modify them as we set them up in the SDKSetitngs.plist for you.

The issue here is a runtime one. dyld_sim requires that all executable images be codesigned. AttributedMarkdown.framework isn't signed, and that is the problem.

How is AttributedMarkdown.framework being built?

@jeremyhu
Copy link

jeremyhu commented Nov 5, 2016

You can also just sign it yourself as a workaround for now:

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

@jeremyhu
Copy link

jeremyhu commented Nov 5, 2016

Based on the build log that you provided out of band, the issue is seen in the xcodebuild command line. You're passing

CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO CODE_SIGN_IDENTITY=

Setting CODE_SIGN_IDENTITY as empty (and CODE_SIGNING_ALLOWED=NO) will cause xcodebuild to not codesign the product. I strongly suggest you do not modify CODE_SIGNING_ALLOWED and CODE_SIGNING_REQUIRED. They are set by the SDK's SDKSettings.plist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment