I ended up removing the pre-build Research.framework
and adding the full Project instead:
- Remove the Pre-built
ResearchKit.framework
file, select Move to Trash
when prompted.
- Make sure the ResearchKit project is closed (if it's open it wont be added as a project but as a file)
- Drag and drop the
ResearchKit.xcodeproj
project file, into destination project. After this make sure the ResearchKit project has its files under it.
- Go to Main project file of your project (not ResearchKit) and select your Target.
- Make sure
ResearchKit.framework
is listed under Embed Frameworks
. If not, then add it by selecting the +
button and selecting it from the list. If it is not on that list then build the ResearchKit project to create the .framework
file.
- Under the same Target, go to Build Phases, and make sure
ResearchKit.Framework
is added under Link Binary with Libraries
, and also under Embed Frameworks
. If not then add it where absent.
- Build and run.
There may be better ways to resolve the issue, but for now this works for me to run the App. App now runs on simulator. However, an initial build takes up-to a minute because the ResearchKit project it pretty big.
Update: I later figured out that the reason why I was encountering the 'Image not found' error is that I was trying to run on simulator while the ResearchKit framework had been build to target arm64 (real device). You will have the same issue the other way around (attempting to run on device-arm64 while app was build for simulator).
So how do the above steps fix this? That fixes the issue because by having the ResearchKit project files included you get to build everything for the currently selected architecture, whether device, or simulator. Happy coding.