I'm getting the following error from XCode over and over:
ld: library not found for -lMyLib for architecture arm64
The problem is that that lib is actually a subtarget of an embedded framework to the main project.
So my project had Embedded(+ Linked) framework and that framework has sub-target (generated with SPM) which is MyLib.
You should add
MyLib
reference manually to the main project, add this library into Build Phases -> Link Binary With Libraries.