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.

Would you be able to share a copy of your project so we can look at details? You can do so here with a link to it hosted somewhere if that's something you can do. If you can't do that but are willing to share it with me directly, you can send me a copy by opening a support request, and I can provide a private upload location to you that way. Once I have a copy of the project to look at, we can continue the conversation in this thread to share what we learn as a resolution with the community.

— Ed Ford,  DTS Engineer

Happy to share it with you privately. Thank you.

@Straker, it looks like a didn't include a link for how to open a support request that will reach me, I'm sorry about that! Please see Code-level support and cite this thread in the referral field.

— Ed Ford,  DTS Engineer

Xcode - Product > Archive files
 
 
Q