【问题标题】:XCode linker error after migrating to Cocoa Pods迁移到 Cocoa Pods 后出现 XCode 链接器错误
【发布时间】:2023-03-22 00:09:01
【问题描述】:

问题

我对 iOS 开发和 XCode 还很陌生,所以如果问题中缺少任何细节,请发表评论并告诉我。

我们已将 SDK 从可下载的存档文件迁移到 Cocoa Pods。我们的一位合作伙伴尝试使用我们的 Pod,但 XCode 链接器给出了以下错误:

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_TAGContainerOpener", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_TAGManager", referenced from:
      objc-class-ref in AppDelegate.o
      objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

项目中的Pod文件为:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'

target 'Demo' do

pod 'GoogleAppIndexing'
pod 'GoogleMaps'
pod 'OurPod', :git => 'https://github.com/AcmeCorp/OurPod.git'

end

target 'DemoTests' do

end

其他设置

  • 我们正在打开 xcworkspace 文件(不是 xcode.proj 文件)。

我尝试了什么

  • 我已尝试搜索错误,但没有发现任何相关内容。

知道我应该寻找什么吗?

提前致谢!

【问题讨论】:

  • 你打开xcworkspace了吗?您应该打开 xcworkspace 而不是 xcode.proj 文件。
  • @TejaNandamuri 是的,更新了我的问题。

标签: ios xcode linker cocoapods


【解决方案1】:

尝试将 Google 跟踪代码管理器GoogleAnalytics 添加到我的应用时遇到了同样的问题

 Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_TAGContainerOpener", referenced from:
  objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_TAGManager", referenced from:
  objc-class-ref in ViewController.o
  objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我想你错过了一些图书馆。 尝试将 libGoogleAnalyticsServices.a 添加到您的项目中。 这修复了我的编译错误

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-14
    相关资源
    最近更新 更多