简体   繁体   English

Firebase MLKit 迁移 - 架构 x86_64 的未定义符号

[英]Firebase MLKit migration - Undefined symbols for architecture x86_64

My setup with Firebase is based on Carthage and everything is working great with that.我对 Firebase 的设置基于 Carthage,一切都很好。 But now that we have migrated to MLKit (they do not have support for Carthage) we have included 2 of the libraries from MLKit that we need through Cocoapods, but we keep on getting this linker errors.但是现在我们已经迁移到 MLKit(他们不支持 Carthage),我们通过 Cocoapods 包含了 MLKit 中的 2 个库,但我们不断收到此链接器错误。

 Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_GULSwizzler", referenced from:
      objc-class-ref in GoogleAppMeasurement(UIViewController+APMScreenClassName_af3349bd4002ca3c2f62fd10b41b3eb5.o)
      objc-class-ref in FirebasePerformance(FPRSelectorInstrumentor.o)
      objc-class-ref in FirebasePerformance(FPRProxyObjectHelper.o)
  "_OBJC_CLASS_$_GULSceneDelegateSwizzler", referenced from:
      objc-class-ref in FirebaseAuth(FIRAuth.o)
  "_kGULNetworkHTTPStatusCodeNotModified", referenced from:
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_d6638b533a7cdc437824cf7209ad695a.o)
      ___46-[APMMeasurement(URL) requestDeferredDeepLink]_block_invoke in GoogleAppMeasurement(APMMeasurement+URL_89002570063d654e31cbed7a49d52cf9.o)
  "_kGULNetworkHTTPStatusCodeNotFound", referenced from:
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_d6638b533a7cdc437824cf7209ad695a.o)
  "_kGULNetworkHTTPStatusCodeCannotAcceptTraffic", referenced from:
      -[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement(APMMeasurement_d6638b533a7cdc437824cf7209ad695a.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_d6638b533a7cdc437824cf7209ad695a.o)
      -[APMETaskManager handleFetchingExperimentsResponse:data:error:] in GoogleAppMeasurement(APMETaskManager_93d6b77f5177bbfd267beceb0e63504e.o)
  "_kGULNetworkHTTPStatusNoContent", referenced from:
      -[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement(APMMeasurement_d6638b533a7cdc437824cf7209ad695a.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_d6638b533a7cdc437824cf7209ad695a.o)
      -[APMETaskManager handleFetchingExperimentsResponse:data:error:] in GoogleAppMeasurement(APMETaskManager_93d6b77f5177bbfd267beceb0e63504e.o)
      ___46-[APMMeasurement(URL) requestDeferredDeepLink]_block_invoke in GoogleAppMeasurement(APMMeasurement+URL_89002570063d654e31cbed7a49d52cf9.o)
  "_kGULNetworkHTTPStatusCodeUnavailable", referenced from:
      -[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement(APMMeasurement_d6638b533a7cdc437824cf7209ad695a.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_d6638b533a7cdc437824cf7209ad695a.o)
      -[APMETaskManager handleFetchingExperimentsResponse:data:error:] in GoogleAppMeasurement(APMETaskManager_93d6b77f5177bbfd267beceb0e63504e.o)
  "_OBJC_CLASS_$_GULNetwork", referenced from:
      objc-class-ref in GoogleAppMeasurement(APMAnalytics_8aebbab89e8f679989831a91d692718a.o)
      objc-class-ref in GoogleAppMeasurement(APMMeasurement_d6638b533a7cdc437824cf7209ad695a.o)
      objc-class-ref in GoogleAppMeasurement(APMAppDelegateInterceptor_8e30f6012706bd788ce60da1e2c6b7b7.o)
      objc-class-ref in GoogleAppMeasurement(APMETaskManager_93d6b77f5177bbfd267beceb0e63504e.o)
  "_OBJC_CLASS_$_GULAppDelegateSwizzler", referenced from:
      objc-class-ref in GoogleAppMeasurement(APMAnalytics_8aebbab89e8f679989831a91d692718a.o)
      objc-class-ref in FirebaseAuth(FIRAuth.o)
  "_kGULNetworkHTTPStatusOK", referenced from:
      -[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement(APMMeasurement_d6638b533a7cdc437824cf7209ad695a.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_d6638b533a7cdc437824cf7209ad695a.o)
      -[APMETaskManager handleFetchingExperimentsResponse:data:error:] in GoogleAppMeasurement(APMETaskManager_93d6b77f5177bbfd267beceb0e63504e.o)
      ___46-[APMMeasurement(URL) requestDeferredDeepLink]_block_invoke in GoogleAppMeasurement(APMMeasurement+URL_89002570063d654e31cbed7a49d52cf9.o)
  "_OBJC_CLASS_$_GULObjectSwizzler", referenced from:
      objc-class-ref in FirebasePerformance(FPRNetworkTrace.o)
      objc-class-ref in FirebasePerformance(FPRNSURLConnectionInstrument.o)
      objc-class-ref in FirebasePerformance(FPRObjectInstrumentor.o)
  "_OBJC_CLASS_$_GULMutableDictionary", referenced from:
      objc-class-ref in GoogleAppMeasurement(APMEExperiment_b4b8ea2ce659b487b048910f72991ad3.o)
      objc-class-ref in GoogleAppMeasurement(APMEExperimentRequestBuilder_43951e9ffb98994ef55aaa739e6b31f6.o)
      objc-class-ref in GoogleAppMeasurement(APMEManager_571d5ebf632e7ae66d886cd64faba90f.o)
      objc-class-ref in GoogleAppMeasurement(APMRemoteConfig_5115867d904d12fe7a11986cd4c600a1.o)
      objc-class-ref in GoogleAppMeasurement(APMESnapshot_013c5a04b20274dfe2124ec50deb4011.o)
ld: symbol(s) not found for architecture x86_64

Setting everything up with Cocoapods does not throw this linker issues.使用 Cocoapods 设置所有内容不会引发此链接器问题。 But we want to really try to keep the Carthage setup for Firebase.但我们想真正尝试保留 Firebase 的 Carthage 设置。

My Podfile includes these two pods:我的 Podfile 包括这两个 Pod:

  pod 'GoogleMLKit/BarcodeScanning'
  pod 'GoogleMLKit/ObjectDetection'

and my Cartfile looks as follows:我的 Cartfile 如下所示:

binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" == 6.33.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseCrashlyticsBinary.json" == 6.33.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json" == 6.33.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebasePerformanceBinary.json" == 6.33.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json" == 6.33.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseProtobufBinary.json" == 6.33.0

It's not supported to mix Carthage and CocoaPods.不支持混合 Carthage 和 CocoaPods。 Both MLKit and Firebase have conflicting sets of dependencies on the GoogleUtilities framework that don't get correctly resolved. MLKit 和 Firebase 对 GoogleUtilities 框架的依赖项集存在冲突,这些依赖项没有得到正确解决。

It may be possible to workaround by removing the GoogleUtilities.framework from the Carthage installation and then explicitly adding the necessary set of its subspecs in the Podfile.可以通过从 Carthage 安装中删除 GoogleUtilities.framework 然后在 Podfile 中显式添加其子规范的必要集来解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM