sparkle-project / Sparkle

A software update framework for macOS
https://sparkle-project.org
Other
7.37k stars 1.05k forks source link

Sparkle.framework "bundle format unrecognized, invalid, or unsuitable" #2413

Closed 101airborne closed 1 year ago

101airborne commented 1 year ago

Description of the problem

Can not build on macOS 10.15 (Catalina) with Xcode 11.7 or 12.4.

Do you use Sandboxing in your app?

NO

Version of Sparkle.framework in the latest version of your app

2.4.2

Version of Sparkle.framework in the old version of app that your users have (or N/A)

N/A

Sparkle's output from Console.app

Xcode build fails:

CodeSign /Users/leg/Library/Developer/Xcode/DerivedData/TestSparkle4-ghdhyvbisqjidwezsgxwexepjqcg/Build/Products/Debug/TestSparkle4.app/Contents/Frameworks/Sparkle.framework/Versions/A (in target 'TestSparkle4' from project 'TestSparkle4')
    cd /Users/leg/Desktop/TestSparkle4
    export CODESIGN_ALLOCATE\=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

Signing Identity:     "Apple Development: Lxxx Gyyy(zzzzzzzzzz)"

    /usr/bin/codesign --force --sign 8154435xxxxxxxxxxxx22E5B9A79352520781 -o runtime --timestamp\=none --preserve-metadata\=identifier,entitlements,flags /Users/leg/Library/Developer/Xcode/DerivedData/TestSparkle4-ghdhyvbisqjidwezsgxwexepjqcg/Build/Products/Debug/TestSparkle4.app/Contents/Frameworks/Sparkle.framework/Versions/A

/Users/leg/Library/Developer/Xcode/DerivedData/`TestSparkle4`-ghdhyvbisqjidwezsgxwexepjqcg/Build/Products/Debug/TestSparkle4.app/Contents/Frameworks/Sparkle.framework/Versions/A: **bundle format unrecognized, invalid, or unsuitable**
Command CodeSign failed with a nonzero exit code

Steps to reproduce the behavior

I created a minimum macOS Sparkle test app named TestSparkle4 with Xcode template: storyboard and Objective-C. App builds, runs, and performs check-for-updates correctly when done so with Xcode 14.2 on macOS 12.6.6 (Monterey.)
On Catalina I have built the app adding Sparkle.framework with Swift Package Manager and I have also tried building and adding Sparkle.framework manually. In all cases I get the same "bundle format unrecognized, invalid, or unsuitable" codesign error.

I have a need to build and test my production apps in both Catalina and Monterey.

I decided to build this test app because I was unable to get Sparkle working as a plugin for my Mac Catalyst app. I thought I would (on Monterey with Xcode 12.4) build a test app to verify that my appfeed configuration and my Developer ID signed updates were working in a normal macOS app. I was unable to get that working until I set App Sandboxing to NO. (another problem for another day.) So, I believe the test app is basically sound––it just won't build on macOS 10.15 Catalina.

I have also tried to build the Sparkle Test App (on Catalina with Xcode 12.4 and on Monterey with Xcode 14.2) from the Sparkle 2.4.2 source. On Monterey Sparkle Test App builds and runs as advertised, but on Catalina I get the same errors as on my Test app:

/Users/leg/Library/Developer/Xcode/DerivedData/Sparkle-dkduiqenepckscgnvplfedmmhygc/Build/Products/Debug/Sparkle Test App.app/Contents/Frameworks/Sparkle.framework/Versions/A: bundle format unrecognized, invalid, or unsuitable Command CodeSign failed with a nonzero exit code

[The more information provided and pasted verbatim, the easier it will be to diagnose an issue. If you can provide the affected application/binary and XML feed to reproduce an issue, share them]

zorgiepoo commented 1 year ago

You might be able to workaround the code signing issue by adjusting FRAMEWORK_VERSION as noted in https://github.com/sparkle-project/Sparkle/issues/2069.

As indicated on the ReadMe under Requirements:

Build: Latest major Xcode (stable or beta, whichever is latest) and one major version less.

We do not officially support building the latest version of Sparkle with Xcode versions that old. The current "supported" requirement is either Xcode 14.3.1 (macOS Ventura) or Xcode 15 (beta; macOS Sonoma). It's ill-advised in general to build with older SDKs. Testing and supporting older operating systems does not and should not require building on them.

101airborne commented 1 year ago

Thanks Zorg. I tried your workaround and was able to build the framework, and build my test app. The test app now runs but gets an error during check-for-update. Since I now know that Xcode 12.4 is not recommended with Sparkle, I have decided to abandon building with it.