首页 > 解决方案 > Swift+Cocoapods:ld:警告:找不到或使用自动链接库“deepspeech”

问题描述

有谁知道为什么 RN 模块 cocoapod 会工作一晚,然后第二天就停止工作,尽管没有任何变化?我正在为 DeepSpeech 构建一个 React Native 模块:https ://github.com/zaptrem/react-native-transcription

其中一部分是使用 s.vendored_frameworks 配置 podspec 以使用预编译的 deepspeech_ios.framework。另一部分是使用 cocoapods-user-defined-build-types 插件使 cocoapods 仅将我的 pod 视为 dynamic_framework。它昨晚还在工作,但今天整个编译都失败了:

ld: warning: Could not find or use auto-linked library 'deepspeech'
Undefined symbols for architecture arm64:
  "_DS_Version", referenced from:
      deepspeech_ios.DeepSpeechVersion() -> Swift.String in deepspeech_ios(DeepSpeech.o)
(Many, many more symbols with a similar issue from DeepSpeech)

我尝试回滚到我确定它有效的提交,但我得到了相同的结果。

我还发现该项目不能永远加载。

标签: swiftreact-nativecocoapods

解决方案


删除并重新制作 Xcode 项目文件和 deepspeech_ios.framework 修复了该问题。可能是 DeepSpeech 版本不匹配?使用此库时,也经常需要清除构建文件夹。


推荐阅读