Can build my app but not Archive

Apologies that this is probably a simple problem.

I've started from a sample code provided by Apple and changed it quite significantly. However, I'm not able to Archive the app.

The original visionOS sample code has the same issue, so hopefully someone will be able to spot the problem:

https://developer.apple.com/documentation/visionos/creating-stereoscopic-image-in-visionos

The problems shown in the log are: Undefined symbol: _main Linker command failed with exit code 1 (use -v to see invocation)

The first error seems to say that there's no "main" but there is indeed a @main in the EntryPoint.swift file.

Any ideas? I have archived other apps (built from scratch) successfully, but clearly there's something different about this sample code.

Many thanks!

At what stage precisely do you get the error ?

Starting from the VisionOS template, in Xcode 16.2, I was able to Archive (for validation).

I just had to add the icons and give a name that was not yet used.

Thanks very much for trying it out — I've just tried again and it's still failing for me. I've given a unique name and added icons but I'm getting the same error. I am able to archive another app I've been working on, so it's specific to this project.

I get the error when choosing Product > Archive. Running the app works fine, installing to the Vision Pro works fine. I've attached a snap from the failed build log.

Can build my app but not Archive
 
 
Q