SwiftPM binaryTarget dependency and code signing

Xcode 12.2 final and 12.3 beta 1 don't fix this either

Not trying to be rude or anything, I'm just keeping people up to date so that they don't waste time testing :slight_smile:


I am still experiencing this issue with Xcode 12.3 RC

1 Like

This is our work around for static framework embedding problem if anyone needs an example. Excuse my scripting... I don't do this often :slight_smile:

ARCHIVE_APP is just a the path to the app inside the xcarchive bundle. We codesign the whole the whole thing again right after we remove these static frameworks.

The gist is we check the executable using the file command and if the word dynamically is not found in the output from file we remove the framework.

for FRAMEWORK in "${ARCHIVE_APP}"/frameworks/*.framework
        echo "Found '${FRAMEWORK}'."
        EXEC=$(/usr/libexec/PlistBuddy -c "print :CFBundleExecutable" "${FRAMEWORK}/Info.plist")
        FILE_INFO=$(/usr/bin/file "${FRAMEWORK}/${EXEC}")
        if [[ -n "$(echo $FILE_INFO | grep -v dynamically)" ]]; then #if FILE_INFO is not empty
          echo "Removing '${FRAMEWORK}'"
          rm -r "${FRAMEWORK}"

Edit: As for efficacy, we ship tons of internal testing builds through this bit of script, so far it has not caused any issues for us.

thanks for this new workaround, can you clarify how to get proper value for ARCHIVE_APP?

The ARCHIVE_APP is the path to your app inside of an xcarchive bundle. The xcarchive bundle is the output of our Release build on our continuous integration servers.

For example our path is /<working directory>/ForeFlight.xcarchive/Products/Applications/ForeFlight.

I am happy to report that it looks like that Xcode 12.5b1 has fixed the issue.

FYI, Apple has acknowledged the issue in 12.4's release notes and documented a workaround

Terms of Service

Privacy Policy

Cookie Policy