微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在将ios小部件添加到现有的react-native项目后无法构建:找不到针对架构x86_64的符号

如何解决在将ios小部件添加到现有的react-native项目后无法构建:找不到针对架构x86_64的符号

我有一个现有的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

Solution here来自Github。

从以下位置更改LIBRARY_SEARCH_PATHS

"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",

收件人:

"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"",

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。