3

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.

sebastianr
  • 657
  • 1
  • 7
  • 10
  • Try to set `Build Active Architecture` only to `YES` – pkc456 Aug 24 '16 at 12:21
  • Thanks @pkc456 for your answer. However, I already tried that before but with no luck. Apparently it is not an architecture issue (armv7 / arm64) but rather a visibility issue with symbols. I just updated my question reflecting this. When I finally figure out if this is a bug in ResearchKit or just me using an invalid approach to solve my original problem I'll update my question to reflect this. – sebastianr Aug 24 '16 at 13:04
  • you should submit this as an answer and accept it! helped me track down another bug, thanks :) – Logan Oct 16 '19 at 23:02

1 Answers1

0

I had the same issue this time with: ORKVisualConsentStep

added and it worked all the logic points out that this is a arm64 issue but it's not, thanks for the hint.

ORK_CLASS_AVAILABLE @interface ORKVisualConsentStep : ORKStep

I had so many problems with Researckit framework might as well spend the time to build my own frame work if you are new to Researchkit try to avoid it, it only useful for very simple projects

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Vikram Parimi Sep 16 '22 at 12:08