【问题标题】:react-native-intercom throws cryptic error - Undefined symbols for architecture x86_64react-native-intercom 引发神秘错误 - 架构 x86_64 的未定义符号
【发布时间】:2018-08-09 13:55:32
【问题描述】:

我正在使用 react-native-intercom 插件以及使用手动链接的最新对讲 ios 库。

项目在链接阶段之前构建良好,然后引发此错误。

我已经完成了对讲机手动链接过程中描述的所有步骤,包括在构建设置中添加条框架脚本作为运行脚本阶段。

这是它抛出的错误消息。

undef: _OBJC_CLASS_$_ICMCompany
undef: _OBJC_CLASS_$_ICMUserAttributes
undef: _IntercomUnreadConversationCountDidChangeNotification
undef: _OBJC_CLASS_$_Intercom
Undefined symbols for architecture x86_64:
   "_OBJC_CLASS_$_ICMCompany", referenced from:
  objc-class-ref in libRNIntercom.a(IntercomUserAttributesBuilder.o)
  "_OBJC_CLASS_$_ICMUserAttributes", referenced from:
  objc-class-ref in libRNIntercom.a(IntercomUserAttributesBuilder.o)
  "_IntercomUnreadConversationCountDidChangeNotification", referenced 
from:
  ___48-[IntercomEventEmitter handleUpdateUnreadCount:]_block_invoke in libRNIntercom.a(IntercomEventEmitter.o)
  -[IntercomEventEmitter constantsToExport] in libRNIntercom.a(IntercomEventEmitter.o)
  -[IntercomEventEmitter supportedEvents] in libRNIntercom.a(IntercomEventEmitter.o)
  -[IntercomEventEmitter startObserving] in libRNIntercom.a(IntercomEventEmitter.o)
 "_OBJC_CLASS_$_Intercom", referenced from:
  objc-class-ref in AppDelegate.o
 (maybe you meant: _OBJC_CLASS_$_IntercomUserAttributesBuilder, 
 _OBJC_CLASS_$_IntercomWrapper , _OBJC_CLASS_$_IntercomEventEmitter )
 ld: symbol(s) not found for architecture x86_64
 clang: error: linker command failed with exit code 1 (use -v to see 
 invocation)

我认为它与项目支持的框架架构有关,但我是 iOS 构建的新手,不知道如何解决这个问题。

【问题讨论】:

    标签: ios xcode react-native linker-errors intercom-ios


    【解决方案1】:

    Intercom installation 期间有一个步骤可以添加“运行脚本阶段”

    bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Intercom.framework/strip-frameworks.sh"

    您需要确保此阶段实际正在执行。

    尝试使用无效路径,例如/Intercom.framework/foo/strip-frameworks.sh,如果构建过程没有由于上述更改而出错,则说明其他地方存在问题,您需要确保已正确执行其他安装步骤。

    只要此脚本运行,它就会正确剥离框架。

    我也花了一些时间,但我能够以这种方式对其进行调试,并最终让它与 12.3.0 一起工作。

    【讨论】:

    • 我花了一段时间才确认该步骤是否正在运行。尽管配置看起来正确,但如果未能正确运行,似乎有很多次。最终它成功了,但在用它烧伤了我自己之后。
    • 这里也一样。将其全部删除,再次执行确切步骤,并且成功了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-02-15
    • 1970-01-01
    • 2018-01-14
    • 2015-10-27
    • 1970-01-01
    • 2014-05-14
    • 2016-05-31
    相关资源
    最近更新 更多