ERROR: "Failed to build the scheme (APP NAME)"

Hello, I'm kinda new to Xcode and I was trying to get back to programming while I follow a course.

There seemed to be a problem with the preview and it looks like there was nothing wrong with the code, at least from what I know. I can say this because the code is the default one that Xcode gives you when you start a new project.

here is the error log.

== PREVIEW UPDATE ERROR:

SchemeBuildError: Failed to build the scheme “App”

linker command failed with exit code 1 (use -v to see invocation)

Link App.debug.dylib (arm64):
Undefined symbols for architecture arm64:
  "_main", referenced from:
      ___debug_main_executable_dylib_entry_point in command-line-aliases-file
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

== PREVIEW UPDATE ERROR:

SchemeBuildError: Failed to build the scheme “App”

linker command failed with exit code 1 (use -v to see invocation)

Link App.debug.dylib (arm64):
Undefined symbols for architecture arm64:
  "_main", referenced from:
      ___debug_main_executable_dylib_entry_point in command-line-aliases-file
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It would help to see the code on which error is reported…

And please tell about the context.

  • Is it a SwiftUI app ?
  • Is it a problem in Preview ?
  • Or is it when you try to run on simulator ?
ERROR: "Failed to build the scheme (APP NAME)"
 
 
Q