Hello,
I am developing an app for the Swift Student challenge; however, I keep encountering an error when using ClassifyImageRequest from the Vision framework in Xcode:
VTEST: error: perform(_:): inside 'for await result in resultStream' error: internalError("Error Domain=NSOSStatusErrorDomain Code=-1 \"Failed to create espresso context.\" UserInfo={NSLocalizedDescription=Failed to create espresso context.}")
It works perfectly when testing it on a physical device, and I saw on another thread that ClassifyImageRequest doesn't work on simulators. Will this cause problems with my submission to the challenge?
Thanks
You'll need to check how projects for the challenge are being evaluated. The last I'd heard evaluation was done on Simulator and you'll want to verify that.
If this is working as expected on actual device then I suspect
\"Failed to create espresso
context.\" UserInfo={NSLocalizedDescription=Failed to create espresso context.}")
Refers to missing hardware support i.e.
"When running apps in Simulator, some hardware-specific features might not be available. Frameworks that provide access to device-specific features also provide API to tell you when those features are available. Call those APIs and handle the case where a feature isn’t available. To test the feature itself, run your code on a real device."
Note: "provide API to tell you when those features are available" i.e. be sure to query for image classification support on Simulator.