4
votes

I'm attempting to use the Branch.io iOS SDK in my iOS app, and I'm getting the following error when I try to compile:

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_CSSearchableIndex", referenced from: objc-class-ref in BranchCSSearchableItemAttributeSet.o "_OBJC_CLASS_$_CSSearchableItem", referenced from: objc-class-ref in BranchCSSearchableItemAttributeSet.o "_OBJC_CLASS_$_CSSearchableItemAttributeSet", referenced from: _OBJC_CLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o
"_OBJC_METACLASS_$_CSSearchableItemAttributeSet", referenced from: _OBJC_METACLASS_$_BranchCSSearchableItemAttributeSet in BranchCSSearchableItemAttributeSet.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

As the tutorial described, I have the Branch-SDK folder correctly added to the project, I configured the PLST, and added all the code in the AppDelegate.m. I skipped step 3 for enabling universal links, because I won't need that yet.

What am I missing that could be causing this? For this sort of error with other frameworks, it tends to be caused by incorrect declaration of the class, but I don't see where I'm doing that incorrectly.

1
I suggest to verify if build only architecture is set to NO in the build settings.tdelepine
For "Build Active Architecture Only", Debug is set to "Yes", and Release is set to "No".Andrew
switch all configurations to NOtdelepine
Still getting the same error.Andrew
Under Build Settings, what do you have listed for Valid Architectures? Did you install the Branch SDK via CocoaPods, or manually? If manually, make sure all the Branch files are included in the target's Build Phases -> Compile Sources, especially BranchCSSearchableItemAttributeSetAlex Bauer

1 Answers

1
votes

For me within the Podfile uncommenting the following line and rerunning the installation resolved this kind of issues in XCode:

use_frameworks!

And do a

pod install

And try cleaning and running the app in XCode once again and it should work. It worked for me.