Problem
CoreAI.framework ships only in the device SDK (it's the Neural Engine inference runtime) and is absent from the iOS Simulator SDK. The library targets currently guard only the macOS-x86_64 case (#if !((os(macOS) || targetEnvironment(macCatalyst)) && arch(x86_64))), so every source that import CoreAI fails to compile for an iOS Simulator destination.
Because Xcode pre-builds a referenced package for the active destination, any app that links a CoreAI product (e.g. CoreAILM) on device can no longer build its Simulator slice — it fails with no such module 'CoreAI'.
Steps to reproduce
- Add the package
https://github.com/apple/coreai-models to an app target that links CoreAILM (or any CoreAI* library).
- Select an iOS Simulator destination (e.g. iPhone 17, iOS 27.0).
- Build.
→ Fails with no such module 'CoreAI' across CoreAILanguageModels / CoreAIDiffusionPipeline / CoreAIImageSegmenter / CoreAIObjectDetector.
Environment: Xcode 27.0 beta · iPhoneSimulator 27.0 SDK · iOS 27.0 deployment.
Proposed fix (ready & verified)
Guard the CoreAI-dependent sources behind #if canImport(CoreAI) — 27 files (every file that imports CoreAI, plus 4 that reference CoreAI-typed symbols: CoreAIRunner, CoreAILanguageModel, PipelineDescriptor, ImageSegmenter). On device canImport(CoreAI) is true and everything compiles unchanged; on the Simulator the CoreAI inference path compiles out (it can't run without the Neural Engine anyway). Purely additive: +54 / −0.
Verified: CoreAILM, CoreAIDiffusion, CoreAISegmentation and CoreAIObjectDetection all build for generic/platform=iOS Simulator (iPhoneSimulator 27.0 SDK).
Branch / diff:
main...KodaKoder:coreai-models:simulator-canimport-guard
I couldn't open a PR directly — PR creation on this repository is currently limited to collaborators. Happy to open one if a maintainer lifts the restriction or wants me to.
Apple Feedback
Also filed as Apple Feedback FB23189921.
Problem
CoreAI.frameworkships only in the device SDK (it's the Neural Engine inference runtime) and is absent from the iOS Simulator SDK. The library targets currently guard only the macOS-x86_64 case (#if !((os(macOS) || targetEnvironment(macCatalyst)) && arch(x86_64))), so every source thatimport CoreAIfails to compile for an iOS Simulator destination.Because Xcode pre-builds a referenced package for the active destination, any app that links a CoreAI product (e.g.
CoreAILM) on device can no longer build its Simulator slice — it fails withno such module 'CoreAI'.Steps to reproduce
https://github.com/apple/coreai-modelsto an app target that linksCoreAILM(or anyCoreAI*library).→ Fails with
no such module 'CoreAI'acrossCoreAILanguageModels/CoreAIDiffusionPipeline/CoreAIImageSegmenter/CoreAIObjectDetector.Environment: Xcode 27.0 beta · iPhoneSimulator 27.0 SDK · iOS 27.0 deployment.
Proposed fix (ready & verified)
Guard the CoreAI-dependent sources behind
#if canImport(CoreAI)— 27 files (every file that imports CoreAI, plus 4 that reference CoreAI-typed symbols:CoreAIRunner,CoreAILanguageModel,PipelineDescriptor,ImageSegmenter). On devicecanImport(CoreAI)is true and everything compiles unchanged; on the Simulator the CoreAI inference path compiles out (it can't run without the Neural Engine anyway). Purely additive: +54 / −0.Verified:
CoreAILM,CoreAIDiffusion,CoreAISegmentationandCoreAIObjectDetectionall build forgeneric/platform=iOS Simulator(iPhoneSimulator 27.0 SDK).Branch / diff:
main...KodaKoder:coreai-models:simulator-canimport-guard
Apple Feedback
Also filed as Apple Feedback FB23189921.