CoreML fails to import for Xcode 12 / watchOS 7 beta

CoreML fails to link and compile the build when trying to use any of its methods in a watchOS app.

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

Any assistance would be helpful!
Answered by BAR115 in 620347022
Sounds like it will be fixed in Xcode 12 Beta 3 +

This 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.

https://forums.swift.org/t/xcode-12-beta-1-swift-5-3-watch-app-fails-to-link-coreml/38090/6
Accepted Answer
Sounds like it will be fixed in Xcode 12 Beta 3 +

This 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.

https://forums.swift.org/t/xcode-12-beta-1-swift-5-3-watch-app-fails-to-link-coreml/38090/6
CoreML fails to import for Xcode 12 / watchOS 7 beta
 
 
Q