Xcode - Product > Archive files

Hello.

I'm working on an app which works on multiple platforms (iOS, macOS, watchOS, tvOS). It builds and runs fine on the simulator and a real device but when trying to create a Product > Archive on macOS, it fails.

Here's the error message I get:

Build target RailBoardMac Project RailBoard | Configuration Debug | Destination Any Mac | SDK macOS 15.1 Link RailBoardMac (x86_64) 0.3 seconds Could not parse or use implicit file '/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SwiftUlCore.framework/ Versions/A/SwiftUlCore.tbd': cannot link directly with 'SwiftUlCore' because product being built is not an allowed client of it less

  • Undefined symbol: _main

× Linker command failed with exit code 1 (use -v to see invocation) Build failed 20/09/2024,

I know this used to work. I must have changed something somewhere and it no longer does.

I'd be grateful for any assistance.

It builds and runs fine on the simulator and a real device but when trying to create a Product > Archive on macOS, it fails.

This is usually an indication that something different happened with your Release build. Archiving uses the Release configuration by default. If you change your build configuration from Debug to Release and then build using the normal build command (not archive), does the same error reproduce?

If so, then I'd look for any differences related to the Release configuration. This could be a variation of build settings configured differently for Release, or it could be due to a compiler macro in your source code, like #if DEBUG.

— Ed Ford,  DTS Engineer

Hi Ed,

Thanks for your help.

I've changed the build configuration from Debug to Release and the normal Build command works fine.

I don't have any compiler macros in the source code.

Straker

I just noticed this in the original message you posted:

Build target RailBoardMac Project RailBoard | Configuration Debug

Your configuration for archiving is set to Debug. Can you check the Archive settings (found in your scheme settings) is set to Release?

—Ed Ford,  DTS Engineer

Thank you for your help.

I have updated the Archive settings to Release and am still getting the same error.

Xcode - Product > Archive files
 
 
Q