【问题标题】:Cannot build after adding ios widget to existing react-native project: symbol(s) not found for architecture x86_64将 ios 小部件添加到现有的 react-native 项目后无法构建:找不到架构 x86_64 的符号
【发布时间】:2020-10-29 03:15:50
【问题描述】:

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

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

我该如何构建它?

【问题讨论】:

    标签: ios widget


    【解决方案1】:

    幸运的是,经过半个小时的搜索。

    找到相同的案例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)\"",
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-21
      • 2018-01-14
      • 1970-01-01
      • 2013-09-29
      • 1970-01-01
      • 2014-08-12
      • 1970-01-01
      • 2018-07-18
      相关资源
      最近更新 更多