CoreML fails to link and compile the build when trying to use any of its methods in a watchOS app.
Error:
Steps to reproduce:
Error:
Code Block Undefined symbols for architecture i386: "_OBJC_CLASS_$_MLPredictionOptions", referenced from: objc-class-ref in ExtensionDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Steps to reproduce:
Create a new watchOS app
Add import CoreML to ExtensionDelegate
Add let _ = MLPredictionOptions() to ExtensionDelegate
Attempt to compile the project
Sounds like it will be fixed in Xcode 12 Beta 3 +
https://forums.swift.org/t/xcode-12-beta-1-swift-5-3-watch-app-fails-to-link-coreml/38090/6This turned out to be a bug in the framework SDK - it should be addressed in a coming beta release of Xcode. Unfortunately, there is no workaround.