I'm on an Intel-based Mac running macOS Sonoma 14.7.1 (23H222) and Xcode Version 16.1 (16B40).
I've created a local StoreKit Configuration File that does not synchronise with App Store Connect and selected it in the Scheme.
I have some products that are consumable in-app purchase and it loads fine as expected when I run the app and I am able to make transactions. It also show up in the Transaction Manager.
After a little while, working on the app, re-running it several times, it stops working. The products do not load the metadata from the StoreKit configuration file.
I also get this error in the console:
Error enumerating unfinished transactions for first transaction listener: Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={AMSStatusCode=0, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <DF5E86B0-0E4A-4982-AF42-FC58FA858C01>.<1>, NSErrorFailingURLKey=http://localhost:51027/inApps/history?guid=F01898465023&reason=initial, _kCFStreamErrorDomainKey=10, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <DF5E86B0-0E4A-4982-AF42-FC58FA858C01>.<1>"
), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=http://localhost:51027/inApps/history?guid=F01898465023&reason=initial, NSUnderlyingError=0x60000038c150 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorDomainKey=10, _kCFStreamErrorCodeKey=-72000, _NSURLErrorNWPathKey_desc=satisfied (Path is satisfied), interface: lo0, _NSURLErrorNWResolutionReportKey_desc=Resolved 0 endpoints in 0ms using unknown from query}}, _kCFStreamErrorCodeKey=-72000}
Restarting the computer resolves the issue but I don't want to restart the computer every single time when it happens and it happens quite soon after a short while.
How can I make sure that it doesn't happen or if it does happen then fix the issue without restarting the computer?
Relaunching Xcode doesn't help and neither does deleting Project Build Data and Indexes.