Firebase架构x86_64的未定义符号

我正在使用firebase作为我在iOS中工作的项目的一部分,当我尝试在iPhone 6或7模拟器上编译我的代码进行测试时,我偶然发现了以下链接错误。

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_GTMSessionUploadFetcher", referenced from: objc-class-ref in FirebaseStorage(FIRStorageUploadTask_d5061b1e2b5f1bb249816cc5fc42ff62.o) "_OBJC_CLASS_$_GTMLogger", referenced from: objc-class-ref in FirebaseMessaging(GIPReachability_ae5504e4a6a28a1d8997c6f38e8bff8b.o) "_kGTMSessionUploadFetcherStandardChunkSize", referenced from: -[FIRStorageUploadTask enqueue] in FirebaseStorage(FIRStorageUploadTask_d5061b1e2b5f1bb249816cc5fc42ff62.o) "_GTMFetcherStandardUserAgentString", referenced from: -[FIRAuthBackendRPCIssuerImplementation init] in FirebaseAuth(FIRAuthBackend_ea73237c278bd1b78e1c76db2a16775a.o) "_OBJC_CLASS_$_GTMSessionFetcher", referenced from: objc-class-ref in FirebaseStorage(FIRStorageDownloadTask_c390366e83519f6636ca985ecb70e5d0.o) objc-class-ref in FirebaseStorage(FIRStorage_691ea9ac7cb4d224d37df2ff8a911989.o) "_OBJC_CLASS_$_GTMSessionFetcherService", referenced from: objc-class-ref in FirebaseAuth(FIRAuthBackend_ea73237c278bd1b78e1c76db2a16775a.o) objc-class-ref in FirebaseStorage(FIRStorage_691ea9ac7cb4d224d37df2ff8a911989.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 

我正在使用Xcode 8.2.1,swift 3.0,我的项目中也有以下Pod文件

 pod 'Braintree' pod 'Firebase/Auth' pod 'Firebase/Database' pod 'Firebase/Core' pod 'Firebase/Storage' pod 'Firebase/Messaging' pod 'Firebase/RemoteConfig' pod 'GeoFire', :git=>'https://github.com/firebase/geofire-objc.git' pod 'ObjectMapper', '~> 2.2' 

我做了一个pod更新,以防有些东西过时,但没有运气。 当我使用iPhone 4或5模拟器时,代码编译并运行正常。

编辑:

我已将Build Active架构设置为No,在有效架构中我列出了arm64,armv7,armv7s,现在Objectmapper失败,即使在文件中声明了import ObjectMapper

  Use of undeclared type 'Mappable' 

任何帮助将不胜感激! 先谢谢你。

乔治。

对我来说,我刚刚将Firebase框架安装到Xcode,而不是因为其他无法解决的问题而使用CocoaPods。 在构建之后存在类似的错误,例如“找不到架构x86_64的符号”。 (也许是因为我在VMWare上使用Xcode)

然后我必须手动转到General – Linked Frameworks and Libraries并添加:

libsqlite3.tbd,libz.tbd,libc ++。tbd

为了项目的工作。

我在这个问题上尝试了解决方案,没有任何效果。 还在SO和GitHub问题中找到了其他线程。 什么都没有帮助。 我正在使用Xcode 9.2,Swift 4,最新版本的cocoa豆荚。 这对我有用……

首先,我的podfile只包含一个firebase pod,因为此时我只使用了Analytics,但是如果你使用更多,解决方法应该是相同的。
pod’Firebase / Core’

其次,与文档状态一样,确保将-ObjC添加到您的其他链接器标志中。 我在项目和目标级别的构建设置中都这样做了。 他们是不同的。

第三也是最重要的,在项目级别的构建设置,其他链接器标志,添加以下内容

-framework

“FirebaseCore”

-framework

“FirebaseAnalytics”

-framework

“FirebaseInstanceID”

-framework

“FirebaseNanoPB”

-framework

“FirebaseCoreDiagnostics”

-framework

“nanopb”

这似乎是衍生数据的一个小故障。 我退出了Xcode,删除了/Users/USER_NAME/Library/Developer/Xcode/PROJECT_NAME所有派生数据

重新启动Xcode,编译并且所有工作都按预期工作,无需在Active Architecture Only或任何内容中进行任何更改。