0

I'm trying to integrate Siri into my app which is Objective-C / Swift. When I try to get data from other classes of my project into the IntentHandler.swift file to determine which contacts match the user's intent I get a Error:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_(ClassName)", referenced from:

followed by

clang: error: linker command failed with exit code 1 (use -v to see invocation)
Enrique Bermúdez
  • 1,740
  • 2
  • 11
  • 25

1 Answers1

2

Your IntentHandler.swift belongs to another target (Siri Intents Extension target) and it can't see classes from your main target.

Quick way to solve this problem is to select class file, you want to use in Siri Intent target Extension, and then add this target to file's TargetMembership (by marking the checkbox with your intents target). That way your intent target can "see" this file and it's classes.

Another way to do it is to create a framework, that comply classes with your business logic, and then use this framework both in your project target and Siri Intents target. More detailed information can be found in Apple documentation

Argas
  • 1,427
  • 1
  • 10
  • 12
  • The quick fix worked for getting rid of the error, but now I'm getting errors that say "Expected a type" and "Cannot find interface declaration for 'UIimage'. When I import "UIKit" it just brings more errors. – Sean Postler Jul 05 '18 at 17:26
  • I also added the UIKit framework to my Siri Intents extension – Sean Postler Jul 05 '18 at 17:27