Reputation: 1096
I have an existing react-native project, after create a new ios widget target, do not modify anything, then build, I got the compile error:
Undefined symbols for architecture x86_64:
"_swift_getOpaqueTypeConformance", referenced from:
money24h_widgetExtension.money24h_widget.body.getter : some in money24h_widget-a02bbe01bccb475d9f71a206fd2ab70cfae065911d2c861c9ce9e26d51e21bf8.o
associated type witness table accessor for SwiftUI.View.Body : SwiftUI.View in money24h_widgetExtension.money24h_widgetEntryView : SwiftUI.View in money24h_widgetExtension in money24h_widget-a02bbe01bccb475d9f71a206fd2ab70cfae065911d2c861c9ce9e26d51e21bf8.o
associated type witness table accessor for SwiftUI.Widget.Body : SwiftUI.WidgetConfiguration in money24h_widgetExtension.money24h_widget : SwiftUI.Widget in money24h_widgetExtension in money24h_widget-a02bbe01bccb475d9f71a206fd2ab70cfae065911d2c861c9ce9e26d51e21bf8.o
associated type witness table accessor for SwiftUI.PreviewProvider.Previews : SwiftUI.View in money24h_widgetExtension.money24h_widget_Previews : SwiftUI.PreviewProvider in money24h_widgetExtension in money24h_widget-a02bbe01bccb475d9f71a206fd2ab70cfae065911d2c861c9ce9e26d51e21bf8.o
l_get_witness_table qd__7SwiftUI19WidgetConfigurationHD2_AaBP0C3KitE11descriptionyQrAA18LocalizedStringKeyVFQOyAcDE24configurationDisplayNameyQrAGFQOyAD06IntentD0Vy24money24h_widgetExtension0dM0CAK0n1_O9EntryViewVG_Qo__Qo_HO in money24h_widget-a02bbe01bccb475d9f71a206fd2ab70cfae065911d2c861c9ce9e26d51e21bf8.o
"_swift_getTypeByMangledNameInContextInMetadataState", referenced from:
___swift_instantiateConcreteTypeFromMangledNameAbstract in money24h_widget-a02bbe01bccb475d9f71a206fd2ab70cfae065911d2c861c9ce9e26d51e21bf8.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Swift version is configured to 5 already.
It seems no one else got this issue.
How can I build it?
Upvotes: 2
Views: 1400
Reputation: 1096
Luckily, after half of an hour searching.
Found the same case here
Solution here from Github.
Change LIBRARY_SEARCH_PATHS
from:
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
to:
"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"",
Upvotes: 4