将 ios 小部件添加到现有的反应本机项目后无法构建:找不到架构 x86_64 的符号

2024-03-17

我有一个现有的react-native项目,在创建新的ios小部件目标后,不修改任何内容,然后构建,我收到编译错误:

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 版本已配置为 5。

似乎没有其他人遇到这个问题。

我该如何构建它?


幸运的是,经过半个小时的寻找。

发现同样的情况here https://ospfranco.github.io/post/2020/08/14/ios-14-widgets-and-react-native/

解决方案在这里 https://github.com/facebook/react-native/issues/29246#issuecomment-663986438来自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)\"",
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

将 ios 小部件添加到现有的反应本机项目后无法构建:找不到架构 x86_64 的符号 的相关文章

随机推荐