I'm working on some prototype which uses ResearchKit. Everything works great when I run the app from XCode either using an iP6 or a simulator. The error shows up when I try to archive my app.
I'm getting the following error:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_ORKQuestionStepCellHolderView", referenced from:
_OBJC_CLASS_$__TtC6myapp11MyCustomView in MyCustomView.o
"_OBJC_METACLASS_$_ORKQuestionStepCellHolderView", referenced from:
_OBJC_METACLASS_$__TtC6myapp11MyCustomView in MyCustomView.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I followed these instructions to include ResearchKit into my project. I tried downloading the source code (I'm using the 'stable' branch), dragging the project into mine, building the RK framework and then adding it as an Embedded Binary. The main issue is with a custom class which is inheriting from ORKQuestionStepCellHolderView. If I get rid of this custom class my error goes away and I'm able to archive my app.
ORKQuestionStepCellHolderView is defined inside ORKCustomStepView.h and .m files.
Any clues as on why I'm getting this issue and ONLY with this specific class (ORKQuestionStepCellHolderView)? Any help will be much appreciated!!
BTW, I'm using XCode 7.3.1 and my project is using mainly Swift. Not sure if this is related to this matter but perhaps it helps.
UPDATE I was finally able to archive the app just by updating ResearchKit code from this:
@interface ORKQuestionStepCellHolderView : ORKQuestionStepCustomView
@property (nonatomic, strong, nullable) ORKSurveyAnswerCell *cell;
@end
to this:
ORK_CLASS_AVAILABLE
@interface ORKQuestionStepCellHolderView : ORKQuestionStepCustomView
@property (nonatomic, strong, nullable) ORKSurveyAnswerCell *cell;
@end
I just posted a question here to see if this is a bug or just me tackling my problem from the wrong angle.
Trying to understand what ORK_CLASS_AVAILABLE does I ended up reading this link about Symbol Visibility.
UPDATE & ANSWER YuanZhu-apple confirmed me here that my approach is correct and that it is definitely a bug in ResearchKit so I'll be posting a PR.