Similar to SwiftUI: Automatic Preview Updating Error "Failed to build ContentView.swift" my code is the same simple SwiftUI code. I can run and compile my code but can't display a preview. For added context my entire project is primarily done with the UIKit framework. I wanted to try having a file with swiftUI code.
== PREVIEW UPDATE ERROR:
LinkDylibError: Failed to build SwiftUIView.swift
Linking failed: linker command failed with exit code 1 (use -v to see invocation)
ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator'
Undefined symbols for architecture x86_64:
"___llvm_profile_runtime", referenced from:
___llvm_profile_runtime_user in MMMCommonCore(MMMNetworkConditioner-0a5a65b36dec9cde1cfd7accf33679dd.o)
___llvm_profile_runtime_user in MMMCommonCore(MMMWeakProxy.o)
___llvm_profile_runtime_user in MMMCommonCore(MMMCommonCore-dummy.o)
___llvm_profile_runtime_user in MMMCommonCore(MMMCommonCore-3ab87d8094d35167218084cd0a765a4e.o)
___llvm_profile_runtime_user in MMMCommonCore(ArrayBuilder.o)
___llvm_profile_runtime_user in MMMCommonCore(CommonCore.o)
___llvm_profile_runtime_user in MMMCommonCore(MMMTimeSource.o)
...
(maybe you meant: ___llvm_profile_runtime_user)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
==================================
| BuildInvocationError
I tried a couple of methods to fix the issue of my SwiftUI view failing to build but none of them worked from https://developer.apple.com/forums/thread/117487, SwiftUI: Automatic Preview Updating Error "Failed to build ContentView.swift".