My app was running perfectly without any errors or warnings yesterday. But when I tried to run it today, the build failed - I haven't changed anything in the code:
Undefined symbol: __swift_FORCE_LOAD_$_XCTestSwiftSupport
How to fix this, and why would something like this occur suddenly when it was working before?
And this is an issue I've been experiencing with XCode a lot lately. My code will be running smoothly without any errors, but then XCode will randomly start throwing errors when I relaunch it at a different time - without making any changes in the actual code.
I have included some photos and the full text of those photos:
InventoryApp 3 issues
Warning
Could not find or use auto-linked library 'XCTestSwiftSupport'
Could not find or use auto linked framework 'XCTest'
Error
Undefined symbol: __swift FORCE LOAD $ XCTestSwiftSupport
ld: warning: Could not find or use auto-linked library 'XCTestSwiftSupport'
ld: warning: Could not find or use auto-linked framework
'XCTest'
Undefined symbols for architecture arm64:
"__swift_FORCE_LOAD_$_XCTestSwiftSupport", referenced from:
__swift_FORCE_LOAD_$_XCTestSwiftSupport_$_inventoryApp in Button.o
__swift_FORCE_LOAD_$_XCTestSwiftSupport_$_inventoryApp in ViewModel.o
__swift_FORCE_LOAD_$_XCTestSwiftSupport_$_inventoryApp in Inventory.o
__swift_FORCE_LOAD_$_XCTestSwiftSupport_$_inventoryApp in AddView.o
__swift_FORCE_LOAD_$_XCTestSwiftSupport_$_inventoryApp in ScannerView.o
__swift_FORCE_LOAD_$_XCTestSwiftSupport_$_inventoryApp in RegisterView.o
__swift_FORCE_LOAD_$_XCTestSwiftSupport_$_inventoryApp in ContentView.o
...
(maybe you meant: __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_inventoryApp)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)