ios - 将ios小部件添加到现有react-native项目后无法构建: symbol(s) not found for architecture x86_64

标签 ios widget

我有一个现有的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)\"",

关于ios - 将ios小部件添加到现有react-native项目后无法构建: symbol(s) not found for architecture x86_64,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64584466/

相关文章:

php - 如何覆盖 WordPress 子主题中的小部件?

c# - 是否可以在自己的 .Net 应用程序中嵌入 Windows Sidebar Widgets

python - 如何自定义表单的属性。在 Django 中选择选项

r - 在 R Shiny 中如何分离 slider 输入值并用它们进行过滤

iphone - 如果你有很多静态数据,如何遵循 MVC?

ios - Objective-C 探测需要配对代码但具有可怕/不透明文档的蓝牙设备

iphone - 何时从 Sandbox 切换到生产 StoreKit 服务器?

Flutter - 检测屏幕上充满其他小部件的点击

ios - 北欧国家没有 CoreData 获取结果

ios - 无法弄清楚如何在 Swift 中使用闭包