Xcode version: 14.1 beta 3 (14B5033e)
It happens often to me that when I try to run the Xcode previews I see a failure of the type
symbol(s) not found for architecture arm64
The full message looks like:
LinkDylibError: Failed to build BannerImageDemoView.swift
Check the issue navigator for any compilation errors.
ld: warning: directory not found for option '-F/Applications/Xcode-beta.app/Contents/SharedFrameworks-iphonesimulator'
Undefined symbols for architecture arm64:
"_$s8SATSCore11BannerImageV13imageViewData5titleAcA0ceF0OSg_SStcfC", referenced from:
_$s7DemoApp011BannerImageA4ViewV0ab20_PreviewReplacement_cdaE2_1E15__preview__body33_E76125F4FD74D49C73B828FC57CA03FALLQrvg7SwiftUI05TupleE0VyAG6SpacerV_8SATSCore0cD0VAKtGyXEfU_ in BannerImageDemoView.1.preview-thunk.o
"_$s8SATSCore11BannerImageV7SwiftUI4ViewAAMc", referenced from:
_$s8SATSCore11BannerImageVAC7SwiftUI4ViewAAWl in BannerImageDemoView.1.preview-thunk.o
"_$s8SATSCore11BannerImageVMa", referenced from:
_$s7DemoApp011BannerImageA4ViewV0ab20_PreviewReplacement_cdaE2_1E15__preview__body33_E76125F4FD74D49C73B828FC57CA03FALLQrvg7SwiftUI05TupleE0VyAG6SpacerV_8SATSCore0cD0VAKtGyXEfU_ in BannerImageDemoView.1.preview-thunk.o
_$s7SwiftUI6VStackVyAA9TupleViewVyAA6SpacerV_8SATSCore11BannerImageVAGtGGWOh in BannerImageDemoView.1.preview-thunk.o
_$s8SATSCore11BannerImageVWOc in BannerImageDemoView.1.preview-thunk.o
_$s8SATSCore11BannerImageVAC7SwiftUI4ViewAAWl in BannerImageDemoView.1.preview-thunk.o
_$s8SATSCore11BannerImageVWOh in BannerImageDemoView.1.preview-thunk.o
_$s7SwiftUI9TupleViewVyAA6SpacerV_8SATSCore11BannerImageVAEtGWOb in BannerImageDemoView.1.preview-thunk.o
_$s7SwiftUI9TupleViewVyAA6SpacerV_8SATSCore11BannerImageVAEtGWOc in BannerImageDemoView.1.preview-thunk.o
...
"_$s8SATSCore11BannerImageVMn", referenced from:
_symbolic _____y_____y___________ACtGG 7SwiftUI6VStackV AA9TupleViewV AA6SpacerV 8SATSCore11BannerImageV in BannerImageDemoView.1.preview-thunk.o
_symbolic _____y_____y_____y___________ACtGG_Qo_ 7SwiftUI4ViewPAAE15navigationTitleyQrAA18LocalizedStringKeyVFQO AA6VStackV AA05TupleC0V AA6SpacerV 8SATSCore11BannerImageV in BannerImageDemoView.1.preview-thunk.o
_symbolic _____y___________ABtG 7SwiftUI9TupleViewV AA6SpacerV 8SATSCore11BannerImageV in BannerImageDemoView.1.preview-thunk.o
_symbolic _____y___________y___________ADtGG 7SwiftUI13_VariadicViewO4TreeV AA13_VStackLayoutV AA05TupleD0V AA6SpacerV 8SATSCore11BannerImageV in BannerImageDemoView.1.preview-thunk.o
_symbolic ___________AAt 7SwiftUI6SpacerV 8SATSCore11BannerImageV in BannerImageDemoView.1.preview-thunk.o
"_$s8SATSCore13ImageViewDataOMa", referenced from:
_$s7DemoApp011BannerImageA4ViewV0ab20_PreviewReplacement_cdaE2_1E15__preview__body33_E76125F4FD74D49C73B828FC57CA03FALLQrvg7SwiftUI05TupleE0VyAG6SpacerV_8SATSCore0cD0VAKtGyXEfU_ in BannerImageDemoView.1.preview-thunk.o
_$s7SwiftUI6VStackVyAA9TupleViewVyAA6SpacerV_8SATSCore11BannerImageVAGtGGWOh in BannerImageDemoView.1.preview-thunk.o
_$s8SATSCore11BannerImageVWOc in BannerImageDemoView.1.preview-thunk.o
_$s8SATSCore11BannerImageVWOh in BannerImageDemoView.1.preview-thunk.o
_$s7SwiftUI9TupleViewVyAA6SpacerV_8SATSCore11BannerImageVAEtGWOb in BannerImageDemoView.1.preview-thunk.o
_$s7SwiftUI9TupleViewVyAA6SpacerV_8SATSCore11BannerImageVAEtGWOc in BannerImageDemoView.1.preview-thunk.o
_$s7SwiftUI9TupleViewVyAA6SpacerV_8SATSCore11BannerImageVAEtGWOh in BannerImageDemoView.1.preview-thunk.o
...
"_$s8SATSCore13ImageViewDataOMn", referenced from:
_symbolic _____Sg 8SATSCore13ImageViewDataO in BannerImageDemoView.1.preview-thunk.o
ld: symbol(s) not found for architecture arm64
This happens when trying to build the previews for this file
our set up is:
- The
DemoApp
is inside the repo of the library calledSATSCore
SATSCore
references a private SPM package dependency calledSATSType
that contains the private font assets
I am not that familiar on how linkers work and why it's failing on Xcode previews.
This happens to me in several version of Xcode 14.
In Xcode 13.4.1 this doesn't happen.
I would like to understand this error, as it's any way to solve this (tried the typical remove derived data + restarting Xcode), so any insights to understand more this kinds of errors would be very helpful.
Thanks
Feedback reported ID: FB11678756
Mmm.. while development I casually added a line, which made importing the SATSCore framework in the file.
That framework was implicitly available already through the @_exported import SATSCore
call in the app’s entry point.
It may seem that this issue may be related to implicitly imported libraries