3

I'm trying to embed the following third party framework in my Xcode project: https://dicomhero.com/downloads/ but Xcode complains that Command CodeSign failed with a nonzero exit code. I've tried one of several things including:

But none of them seem to have worked, and Xcode crashes at start time and suggest moving the framework to the Trash. Is this an issue I can fix on my end, or would I have to contact the developer? Any help would be greatly appreciated!

cyril
  • 3,020
  • 6
  • 36
  • 61
  • Does the framework only provide a dynamic library? If it provides a static library, you could add that as a dependency instead. – Chip Jarred Feb 02 '23 at 04:04
  • Not sure, but [this other question](https://stackoverflow.com/questions/57687170/do-not-embed-embed-sign-embed-without-signing-what-are-they-what-th) might have some useful info. – Chip Jarred Feb 02 '23 at 04:08
  • @ChipJarred none of the suggestions really helped but thank you for trying! – cyril Feb 02 '23 at 04:40

1 Answers1

2

I tried to download the framework using the link you provided, and then embed it into an empty project. Xcode showed the alert about using code from untrusted source.

Untrusted Developer Alert

When you download a file from internet it receives "quarantine" attributes:

$ xattr xcframework.zip 
com.apple.macl
com.apple.quarantine
com.apple.metadata:kMDItemDownloadedDate
com.apple.metadata:kMDItemWhereFroms
com.apple.lastuseddate#PS

com.apple.macl and com.apple.quarantine are the most interesting here.

Not sure what exactly macl means, but I assume it to be some kind of Access Control Layer. The presence of this attribute makes the OS to show this "untrusted developer" alert.

These attributes could be removed with xattr -d. com.apple.quarantine attr gets removed just fine, however com.apple.macl reappears after deleting it.

When you unzip a zip archive by just double clicking on it, Finder re-applies these com.apple.quarantine and com.apple.macl attributes to the unarchived file or directory. But if you decompress the archive with unzip, com.apple.macl will not be applied to the decompressed data.

You could download the archive and then do:

$ cd ~/Downloads
$ unzip xcframework.zip
$ sudo xattr -dr com.apple.quarantine dicomhero6.xcframework

Then drag and drop .xcframework to your Xcode project.

Alternatively you get rid of the "developer cannot be verified" error by just opening the Security and Privacy pane in the System Preferences and "Allow Anyway".

Security and Privacy pane

storoj
  • 1,851
  • 2
  • 18
  • 25
  • I get a 'fopen(/Users/cyril/Downloads/dicomhero6.xcframework/Info.plist, rb): Permission denied (13)' error after dragging to Xcode – cyril Feb 09 '23 at 04:49