iOS Project not compiling after adding Intents.intentdefinition

I'm trying to add a Siri intent to my iOS project.

I've been trying to follow different tutorials, but I always reach the same point (quite early on) where the app doesn't compile.


After adding the Intents.intentdefinition file, and adding my project (and the extensions if I already added them) as target, the project doesn't compile anymore.


The given error is :

    Undefined symbols for architecture x86_64:
  "_OBJC_METACLASS_$_INIntentResponse", referenced from:
      _OBJC_METACLASS_$_IntentIntentResponse in IntentIntent.o
  "_OBJC_CLASS_$_INIntentResponse", referenced from:
      _OBJC_CLASS_$_IntentIntentResponse in IntentIntent.o
  "_OBJC_CLASS_$_INIntent", referenced from:
      _OBJC_CLASS_$_IntentIntent in IntentIntent.o
  "_OBJC_METACLASS_$_INIntent", referenced from:
      _OBJC_METACLASS_$_IntentIntent in IntentIntent.o
ld: symbol(s) not found for architecture x86_64



which theoretically are the auto generated classes by my Intent.


I noticed if I change "intent classes" by "No Generated Classes" on the target membership, the apps compile properly, but every single tutorial I've saw depends on the auto-generated classes.


I also tried doing exactly the same with an empty project, and it does work, which means there must be something on the configuration of my project which is conflicting when generating these classes, but I have no idea what may it be as to even paste here the conf.


So... any tips / help / comments will be super welcome!


Thanks in advance!

Replies

It looks like the Intent framework isn't being linked to the target. In the Build Phases for the target, insure that Intents.framework is present in the Link Binary with Libraries phase.