App targeting iOS 8 with an intent extension crashes in the simulator

- I have an iOS app that targets iOS 8.

- It includes an Intent Extension (for Siri Shortcuts).

- It runs perfectly fine on iOS 12 (device + simulator) and 10 (simulator).

- It crashes immediately in the iOS 8 simulator and outputs the following:


    dyld: Library not loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
      Referenced from: /System/Library/Frameworks/Intents.framework/Intents
      Reason: no suitable image found.  Did find:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices: mach-o, but not built for iOS simulator


I realize that I won't be able to use the Intents Extension on older versions of iOS, but I still want my main app to work. From what I've read online, I should still be able to target 8 even though I use SiriKit. Any Intent related code has been guarded against when iOS < 12.


My project is configured like this:


- Project Deployment Target: 8.0

- Main App Deployment Target: 8.0

- Intents Extension Deployment Target: 12.0


I have tested some things to try to figure out what exactly is causing the problem:


- Removing all my Intents related code in the main app => Does not work

- Removing the Intent Extension target => Does not work

- Removing the Intent Definition File => Works


Is this an issue with Xcode/Simulator?

Replies

You need to set Intents as an Optional linkage so that older iOS versions skip over it. In the build phases for your project, under the Link Binary with Libraries phase, look for the Intents framework, and set it to Optional under the Status column.

@edford Thanks for your reply. Neither my main app target (nor my intents app extension target) include "Intents.framework" as a linked framework. I went ahead and added it and made sure to set it to "Optional" but that did not help. I still get the exact same error message :/

I see the problem:

dyld: Library not loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices  
      Referenced from: /System/Library/Frameworks/Intents.framework/Intents


Your app is using Intents, which on iOS 12, is linked to CoreServices.framework. CoreServices is new on iOS 12, containing the APIs from MobileCoreServices.framework in previous versions of the iOS SDK. You need to add CoreServices.framework to your link list and set it to Optional as well.

I tried adding CoreServices as well (first just the app target, and then both the app and intents extension target). Same issue...

Chiming in here to say that I have exactly the same problem.


I have no devices with older iOS versions, so I can't verify if this applies to those as well or if it's a simulator only situation.

I'm definitely starting to think this is just a bug in the simulator. I created a TSI last week and am awaiting confirmation now. I'll provide more details here once I hear back.


Also, it's worth noting that it seems to be the intent definition file that's the culprit. I created a "demo" project that reproduces the issue for the TSI, which is literally just a new project with an intents definition file (and a test intent).

I received a response to my TSI. They just told me to submit a bug report... I have done that now.

Be sure to add your report # here for reference.


My advice is to forego <10.x support entirely....it's time.

I have the same problem.


I've tried to add CoreServices.framework, MobileCoreServices.framework, and set it to Optional, but it's never been resolved.

I have same issue! I need to find a solution to this problem 😢

I have the same issue with an app in the iOS 9 simulator. I've also tried everything, added all mentioned frameworks as optional, to no avail. It works on an iOS 9 device when built using our build server with ad hoc deployment. But when I try to install it on an iOS 9 device locally from Xcode, a very similar error is printed in the console and it won't even let it install the app.


How about the iOS 9 simulator for you guys?

I've got the same error occuring. building with sdk 12.1 but targeting and running on an ios 9 simulator. ios 11,12 simulators work fine.

We had the same problem with our app not running on an old iPad Mini running iOS 9.3. We had been experimenting with adding Siri support and had left the Intent Framework as a required framework. Removed this framework ( Intents.framework) and the <Intents/Intents.h> header include and it runs fine now.