iOS 应用程序的 Firebase 3.7.0 上的链接错误

Posted

技术标签:

【中文标题】iOS 应用程序的 Firebase 3.7.0 上的链接错误【英文标题】:Linking error on Firebase 3.7.0 for iOS Application 【发布时间】:2016-11-09 14:13:21 【问题描述】:

我正在尝试在我的 ios 应用程序中使用 Firebase SDK 3.7.0,但它给出了链接错误。

我已按照 README.md 中描述的步骤进行操作,该文件包含在从 https://firebase.google.com/docs/ios/setup 下载的框架 SDK 中,关于没有 CocoaPods 部分的集成。

在链接时,出现以下错误:

Undefined symbols for architecture armv7:
  "_sqlite3_bind_double", referenced from:
      ___48-[FIRASqliteStore bindValues:toStatement:error:]_block_invoke in FirebaseAnalytics(FIRASqliteStore_2e8a0f466f3be880241569cb2066f73b.o)
  "_sqlite3_bind_null", referenced from:
      ___48-[FIRASqliteStore bindValues:toStatement:error:]_block_invoke in FirebaseAnalytics(FIRASqliteStore_2e8a0f466f3be880241569cb2066f73b.o)
  "_sqlite3_column_type", referenced from:
      -[FIRASqliteStore valueAtColumn:forStatement:] in FirebaseAnalytics(FIRASqliteStore_2e8a0f466f3be880241569cb2066f73b.o)
  "_sqlite3_column_double", referenced from:
      -[FIRASqliteStore valueAtColumn:forStatement:] in FirebaseAnalytics(FIRASqliteStore_2e8a0f466f3be880241569cb2066f73b.o)
  "_sqlite3_open_v2", referenced from:
      -[FIRASqliteStore openAndValidateDatabase:] in FirebaseAnalytics(FIRASqliteStore_2e8a0f466f3be880241569cb2066f73b.o)
  "_sqlite3_clear_bindings", referenced from:
      -[FIRASqliteStore cleanUpStatement:forQuery:] in FirebaseAnalytics(FIRASqliteStore_2e8a0f466f3be880241569cb2066f73b.o)
      -[FIRASqliteStore bindValues:toStatement:error:] in FirebaseAnalytics(FIRASqliteStore_2e8a0f466f3be880241569cb2066f73b.o)
  "_sqlite3_column_count", referenced from:
      -[FIRASqliteStore recordsForQuery:parameterValues:error:withFilter:] in FirebaseAnalytics(FIRASqliteStore_2e8a0f466f3be880241569cb2066f73b.o)
      -[FIRASqliteStore validateDatabaseWithError:] in FirebaseAnalytics(FIRASqliteStore_2e8a0f466f3be880241569cb2066f73b.o)
  "_OBJC_CLASS_$_s-s-readingList", referenced from:
      objc-class-ref in GoogleSignIn(please_link_SafariServices.framework_.o)
  "_OBJC_CLASS_$_MFMessageComposeViewController", referenced from:
      objc-class-ref in FirebaseInvites(GINInviteController_af66380ba390cf14b066932397806d20.o)
      objc-class-ref in FirebaseInvites(GPPACLSearchViewController_3fc71921176f5b855c444ab9ce9260c7.o)
      objc-class-ref in FirebaseInvites(GINInviteScrollView_5b90efc8e1a69f9dfe581b021e7f869b.o)
  "_OBJC_CLASS_$_CMMotionManager", referenced from:
      objc-class-ref in FirebaseDynamicLinks(GPPSpamSignal_a0a54565a3243ede865cc9b2724bc7a8.o)
  "_sqlite3_column_bytes", referenced from:
      -[FIRMessagingRmq2PersistentStore scanOutgoingRmqMessagesWithHandler:] in FirebaseMessaging(FIRMessagingRmq2PersistentStore_66612bb0cdda59e6a475d66db9ec25d4.o)
      -[FIRASqliteStore valueAtColumn:forStatement:] in FirebaseAnalytics(FIRASqliteStore_2e8a0f466f3be880241569cb2066f73b.o)
  "_sqlite3_reset", referenced from:
      -[FIRASqliteStore cleanUpStatement:forQuery:] in FirebaseAnalytics(FIRASqliteStore_2e8a0f466f3be880241569cb2066f73b.o)
  "_sqlite3_changes", referenced from:
      -[FIRMessagingRmq2PersistentStore deleteMessagesFromTable:withRmqIds:] in FirebaseMessaging(FIRMessagingRmq2PersistentStore_66612bb0cdda59e6a475d66db9ec25d4.o)
      -[FIRMessagingRmq2PersistentStore deleteExpiredOrFinishedSyncMessages:] in FirebaseMessaging(FIRMessagingRmq2PersistentStore_66612bb0cdda59e6a475d66db9ec25d4.o)
      -[FIRASqliteStore deleteRecordsFromTableWithName:condition:parameterValues:error:] in FirebaseAnalytics(FIRASqliteStore_2e8a0f466f3be880241569cb2066f73b.o)
  "_sqlite3_errmsg", referenced from:
      -[FIRMessagingRmq2PersistentStore saveMessageWithRmqId:tag:data:error:] in FirebaseMessaging(FIRMessagingRmq2PersistentStore_66612bb0cdda59e6a475d66db9ec25d4.o)
      -[FIRMessagingRmq2PersistentStore lastErrorMessage] in FirebaseMessaging(FIRMessagingRmq2PersistentStore_66612bb0cdda59e6a475d66db9ec25d4.o)

XCode 版本是 7.0.1

【问题讨论】:

【参考方案1】:

你需要添加这个框架,因为你不使用 Pod

libicucore.tbd

CFNetwork.framework

安全性框架

SystemConfiguration.framework

libc++.tbd

libsqlite3.tbd

对于 2020 年,如果您仍然遇到以下令人发指的错误:

_OBJC_CLASS_$_SKPaymentQueue _OBJC_CLASS__$_SKProductsRequest

然后,另外添加 StoreKit

【讨论】:

【参考方案2】:

不确定为什么必须添加所有这些框架,即使您不使用 pod。我把它整理出来,只添加了 libsqlite3.dylb 和 libs.1.dylib

【讨论】:

以上是关于iOS 应用程序的 Firebase 3.7.0 上的链接错误的主要内容,如果未能解决你的问题,请参考以下文章

Firebase 不适用于 iOS 的生产版本

如何使用 Firebase 分发 iOS 应用程序?

iOS 的 Firebase 通知工作策略

Firebase.google.com iOS 中的 Firebase 动态链接(Swift)

如何向 ios 应用程序发送 Firebase 推送通知

通过 Firebase 获取 iOS 应用的下载次数