【问题标题】:Undefined symbols for architecture x86_64: "_OBJC_METACLASS_$_GMVDetector" referenced from: TextDetector架构 x86_64 的未定义符号:“_OBJC_METACLASS_$_GMVDetector”引用自:TextDetector
【发布时间】:2019-01-26 16:38:44
【问题描述】:

我在项目中加入了 Google Firebase MLKit,但没有使用 cocoapods。当我尝试构建时,我收到 Undefined symbol 错误:Xcode error image

Undefined symbols for architecture armv7:
  "_OBJC_METACLASS_$_GMVDetector", referenced from:
      l45918 in TextDetector
  "_OBJC_CLASS_$_GMVDetector", referenced from:
      l45917 in TextDetector
  "_OBJC_CLASS_$_GMVFeature", referenced from:
      _OBJC_CLASS_$_GMVTextBlockFeature in TextDetector
      _OBJC_CLASS_$_GMVTextLineFeature in TextDetector
      _OBJC_CLASS_$_GMVTextElementFeature in TextDetector
  "_OBJC_METACLASS_$_GMVFeature", referenced from:
      l45914 in TextDetector
      l45915 in TextDetector
      l45916 in TextDetector
  "_OBJC_CLASS_$_GMVUtility", referenced from:
      objc-class-ref in TextDetector
  "_OBJC_CLASS_$_GMVLogger", referenced from:
      objc-class-ref in TextDetector
  "_GMVFeatureTypeTextLine", referenced from:
      l31298 in TextDetector
  "_GMVDetectorImageOrientation", referenced from:
      l31341 in TextDetector
      l31342 in TextDetector
  "_GMVFeatureTypeTextElement", referenced from:
      l31313 in TextDetector
  "_GMVFeatureTypeTextBlock", referenced from:
      l31279 in TextDetector
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

到目前为止我已经尝试过:

  1. 退出 Xcode 然后清理构建
  2. 手动以及拖放框架
  3. 链接了所有需要的资源文件夹
  4. 删除 Xcode 临时文件
  5. 将symbols hidden by default 下的Build Settings 设置为No 虽然框架TextDetector 链接到了正确的目标。

所有这些似乎都不起作用。我关注Integrate without CocoaPods 进行框架设置。

Project Structure Image 和 Architecture in Build Settings

【问题讨论】:

  • 请分享您的项目和目标构建设置的图像,上面写着'Architecture' 和'Valid Architectures'
  • @George_E_2 我用截图编辑了我的帖子。
  • 在我看来,好像您有一些与 armv7 不兼容的 Objective-C 代码。你在调用一些无效的 obj-c 函数吗?

标签: ios xcode xcode9 google-vision google-ios-vision


【解决方案1】:

这个问题已经解决了。我在上面提到的 Firebase 链接中添加了与 .zip 文件一起提供的所有其他框架。 List of Frameworks。这不是一个简单的设置,在readme 和网站中都没有提到。可能所有这些框架都不是必需的,但许多是相互依赖的,因为它们在每个框架的module.modulemap 中指定。

【讨论】:

    猜你喜欢
    • 2017-02-06
    • 2016-11-12
    • 2018-06-23
    • 1970-01-01
    • 1970-01-01
    • 2020-12-21
    • 1970-01-01
    • 1970-01-01
    • 2021-05-04
    相关资源
    最近更新 更多