Firebase-ios-sdk: FirebaseMessaging Carthage

Created on 16 Nov 2018  路  8Comments  路  Source: firebase/firebase-ios-sdk

  • Xcode version: 10.1 (10B61)
  • Firebase SDK version: 5.12.0

After update the Firebase SDK to the last version for Xcode 10 and Swift 4.2 using Carthage, I can no longer compile the project, is returning the error below:

ld: warning: ignoring file /Users/rafaeldepaula/Developer/workspaces/xcode/ubook-reader-ios/Carthage/Build/iOS/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics, file was built for archive which is not the architecture being linked (arm64): /Users/rafaeldepaula/Developer/workspaces/xcode/ubook-reader-ios/Carthage/Build/iOS/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics
Undefined symbols for architecture arm64:
  "_GULSetLoggerLevel", referenced from:
      _FIRSetLoggerLevel in FirebaseCore(FIRLogger.o)
  "_GULLoggerRegisterVersion", referenced from:
      ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
  "_GULLoggerInitializeASL", referenced from:
      ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
  "_GULLoggerEnableSTDERR", referenced from:
      ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
  "_GULLoggerForceDebug", referenced from:
      ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
  "_OBJC_CLASS_$_APMAnalytics", referenced from:
      objc-class-ref in FirebaseAnalytics(FIRAnalytics_b1a58c0e5ea47877b382a92fe9c18663.o)
  "_kAPMMonitorLogTagOptionKey", referenced from:
      +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_b1a58c0e5ea47877b382a92fe9c18663.o)
  "_gAPMAppMeasurementLibraryVersion", referenced from:
      +[FIRAnalytics initialize] in FirebaseAnalytics(FIRAnalytics_b1a58c0e5ea47877b382a92fe9c18663.o)
  "_kAPMIsAnalyticsCollectionEnabled", referenced from:
      +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_b1a58c0e5ea47877b382a92fe9c18663.o)
  "_OBJC_METACLASS_$_APMMeasurement", referenced from:
      _OBJC_METACLASS_$_FIRAMeasurement in FirebaseAnalytics(FIRAMeasurement_f52e0c5ecf54f9c787ce3f87e5967010.o)
  "_APMFormattedUserPropertyName", referenced from:
      +[FIRAnalytics setUserPropertyString:forName:] in FirebaseAnalytics(FIRAnalytics_b1a58c0e5ea47877b382a92fe9c18663.o)
  "_OBJC_CLASS_$_GULUserDefaults", referenced from:
      objc-class-ref in FirebaseInstanceID(FIRInstanceIDStore_23ba01eb205a3ad2c36924a6df31712c.o)
      objc-class-ref in FirebaseInstanceID(FIRInstanceIDCheckinPreferences_36766016f801e2f19278d2e4a3dc9dc2.o)
      objc-class-ref in FirebaseInstanceID(FIRInstanceIDUtilities_6068b4cdd1114b87139202a3c6ae828a.o)
  "_OBJC_METACLASS_$_APMSessionReporter", referenced from:
      _OBJC_METACLASS_$_FIRASessionReporter in FirebaseAnalytics(FIRASessionReporter_4f1a6411673b017977c8eb9f3105197e.o)
  "_OBJC_CLASS_$_APMValue", referenced from:
      _OBJC_CLASS_$_FIRAValue in FirebaseAnalytics(FIRAValue_4c21b84a5eb3e0e007a633cfb3ce3bd9.o)
  "_OBJC_CLASS_$_APMMeasurement", referenced from:
      objc-class-ref in FirebaseAnalytics(FIRAMeasurement_f52e0c5ecf54f9c787ce3f87e5967010.o)
      _OBJC_CLASS_$_FIRAMeasurement in FirebaseAnalytics(FIRAMeasurement_f52e0c5ecf54f9c787ce3f87e5967010.o)
      objc-class-ref in FirebaseAnalytics(FIRAnalytics_b1a58c0e5ea47877b382a92fe9c18663.o)
  "_OBJC_METACLASS_$_APMAdExposureReporter", referenced from:
      _OBJC_METACLASS_$_FIRAAdExposureReporter in FirebaseAnalytics(FIRAAdExposureReporter_e516d08bfa5acfab876b4af79741d03b.o)
  "_OBJC_METACLASS_$_APMConditionalUserProperty", referenced from:
      _OBJC_METACLASS_$_FIRAConditionalUserProperty in FirebaseAnalytics(FIRAConditionalUserProperty_da9132874cf18b1013457ad70c30ebd4.o)
  "_OBJC_METACLASS_$_APMScreenViewReporter", referenced from:
      _OBJC_METACLASS_$_FIRAScreenViewReporter in FirebaseAnalytics(FIRAScreenViewReporter_a7e399dc552c107f9958a5a21dc3ebb8.o)
  "_OBJC_CLASS_$_APMScreenViewReporter", referenced from:
      objc-class-ref in FirebaseAnalytics(FIRAScreenViewReporter_a7e399dc552c107f9958a5a21dc3ebb8.o)
      _OBJC_CLASS_$_FIRAScreenViewReporter in FirebaseAnalytics(FIRAScreenViewReporter_a7e399dc552c107f9958a5a21dc3ebb8.o)
  "_OBJC_CLASS_$_APMAdExposureReporter", referenced from:
      _OBJC_CLASS_$_FIRAAdExposureReporter in FirebaseAnalytics(FIRAAdExposureReporter_e516d08bfa5acfab876b4af79741d03b.o)
  "_APMFormattedEventName", referenced from:
      +[FIRAnalytics logEventWithOrigin:name:parameters:] in FirebaseAnalytics(FIRAnalytics_b1a58c0e5ea47877b382a92fe9c18663.o)
  "_OBJC_CLASS_$_APMConditionalUserProperty", referenced from:
      _OBJC_CLASS_$_FIRAConditionalUserProperty in FirebaseAnalytics(FIRAConditionalUserProperty_da9132874cf18b1013457ad70c30ebd4.o)
  "_OBJC_CLASS_$_APMEvent", referenced from:
      _OBJC_CLASS_$_FIRAEvent in FirebaseAnalytics(FIRAEvent_ab10ffd6164e49ea076c16409eba95e0.o)
  "_kAPMSafelistedEventsOptionKey", referenced from:
      +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_b1a58c0e5ea47877b382a92fe9c18663.o)
  "_OBJC_METACLASS_$_APMEvent", referenced from:
      _OBJC_METACLASS_$_FIRAEvent in FirebaseAnalytics(FIRAEvent_ab10ffd6164e49ea076c16409eba95e0.o)
  "_kAPMIsAnalyticsCollectionDeactivated", referenced from:
      +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_b1a58c0e5ea47877b382a92fe9c18663.o)
  "_OBJC_CLASS_$_APMConditionalUserPropertyController", referenced from:
      _OBJC_CLASS_$_FIRAConditionalUserPropertyController in FirebaseAnalytics(FIRAConditionalUserPropertyController_391de919ca324f4205af528c2f4bf228.o)
  "_OBJC_CLASS_$_APMSessionReporter", referenced from:
      _OBJC_CLASS_$_FIRASessionReporter in FirebaseAnalytics(FIRASessionReporter_4f1a6411673b017977c8eb9f3105197e.o)
  "_GULIsLoggableLevel", referenced from:
      _FIRIsLoggableLevel in FirebaseCore(FIRLogger.o)
  "_OBJC_CLASS_$_APMIdentifiers", referenced from:
      _OBJC_CLASS_$_FIRAIdentifiers in FirebaseAnalytics(FIRAIdentifiers_c39e1836577a1f413945546b36ff1a35.o)
  "_OBJC_CLASS_$_GULReachabilityChecker", referenced from:
      objc-class-ref in FirebaseMessaging(FIRMessaging.o)
  "_OBJC_METACLASS_$_APMIdentifiers", referenced from:
      _OBJC_METACLASS_$_FIRAIdentifiers in FirebaseAnalytics(FIRAIdentifiers_c39e1836577a1f413945546b36ff1a35.o)
  "_GULLogBasic", referenced from:
      _FIRLogBasic in FirebaseCore(FIRLogger.o)
  "_OBJC_METACLASS_$_APMUserAttribute", referenced from:
      _OBJC_METACLASS_$_FIRAUserAttribute in FirebaseAnalytics(FIRAUserAttribute_8b920ceab4b6cf803ac8b113bb48571c.o)
  "_OBJC_CLASS_$_APMUserAttribute", referenced from:
      _OBJC_CLASS_$_FIRAUserAttribute in FirebaseAnalytics(FIRAUserAttribute_8b920ceab4b6cf803ac8b113bb48571c.o)
  "_OBJC_METACLASS_$_APMConditionalUserPropertyController", referenced from:
      _OBJC_METACLASS_$_FIRAConditionalUserPropertyController in FirebaseAnalytics(FIRAConditionalUserPropertyController_391de919ca324f4205af528c2f4bf228.o)
  "_kAPMAnalyticsConfiguration", referenced from:
      +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_b1a58c0e5ea47877b382a92fe9c18663.o)
  "_kAPMAppMeasurementOriginFirebase", referenced from:
      +[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_b1a58c0e5ea47877b382a92fe9c18663.o)
  "_OBJC_METACLASS_$_APMValue", referenced from:
      _OBJC_METACLASS_$_FIRAValue in FirebaseAnalytics(FIRAValue_4c21b84a5eb3e0e007a633cfb3ce3bd9.o)
  "_OBJC_CLASS_$_GULAppEnvironmentUtil", referenced from:
      objc-class-ref in FirebaseMessaging(FIRMessagingReceiver.o)
      objc-class-ref in FirebaseMessaging(FIRMessagingAnalytics.o)
      objc-class-ref in FirebaseMessaging(FIRMessagingUtilities.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Carthage

Most helpful comment

I have finally solved the issue but i will leave the upper comment so people would know what to do if they are in this situation.

Mainly if you are going to add FirebaseMessaging.framework you will need these combination of different frameworks with it. Without them you will have linker error

Firebase.framework
FirebaseCore.framework
FirebaseInstanceID.framework
GoogleUtilities.framework
Protobuf.framework

Nothing else. Good luck 馃憤

All 8 comments

Please make sure that the GoogleUtilities and GoogleAppMeasurement frameworks are being linked. Both of them should be installed with FirebaseAnalytics.

Hi @paulb777 I had not linked these frameworks. But even after linking, the error continues.

Hi @rafsouzap I'm not sure what's going on in your app. We'll likely need a reproducible example to help with this one.

Same issue here

UPDATE:
The issue is mainly now with FirebaseMessaging.

GtalkCore.pbobjc.o
GtalkExtensions.pbobjc.o
FIRMessagingSecureSocket.o

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_GPBDescriptor", referenced from: objc-class-ref in FirebaseMessaging(GtalkCore.pbobjc.o) objc-class-ref in FirebaseMessaging(GtalkExtensions.pbobjc.o) "_OBJC_CLASS_$_GPBCodedOutputStream", referenced from: objc-class-ref in FirebaseMessaging(FIRMessagingSecureSocket.o) "_OBJC_CLASS_$_GPBFileDescriptor", referenced from: objc-class-ref in FirebaseMessaging(GtalkCore.pbobjc.o) objc-class-ref in FirebaseMessaging(GtalkExtensions.pbobjc.o) "_OBJC_CLASS_$_FIRInstanceID", referenced from: objc-class-ref in FirebaseMessaging(FIRMessaging.o) "_OBJC_METACLASS_$_GPBMessage", referenced from: _OBJC_METACLASS_$_GtalkHeartbeatPing in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_METACLASS_$_GtalkHeartbeatAck in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_METACLASS_$_GtalkErrorInfo in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_METACLASS_$_GtalkSetting in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_METACLASS_$_GtalkHeartbeatStat in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_METACLASS_$_GtalkHeartbeatConfig in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_METACLASS_$_GtalkLoginRequest in FirebaseMessaging(GtalkCore.pbobjc.o) ... "_OBJC_CLASS_$_GPBEnumDescriptor", referenced from: objc-class-ref in FirebaseMessaging(GtalkCore.pbobjc.o) objc-class-ref in FirebaseMessaging(GtalkExtensions.pbobjc.o) "_OBJC_CLASS_$_GPBMessage", referenced from: _OBJC_CLASS_$_GtalkHeartbeatPing in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_CLASS_$_GtalkHeartbeatAck in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_CLASS_$_GtalkErrorInfo in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_CLASS_$_GtalkSetting in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_CLASS_$_GtalkHeartbeatStat in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_CLASS_$_GtalkHeartbeatConfig in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_CLASS_$_GtalkLoginRequest in FirebaseMessaging(GtalkCore.pbobjc.o) ... "_OBJC_CLASS_$_GPBRootObject", referenced from: _OBJC_CLASS_$_GtalkGtalkCoreRoot in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_CLASS_$_GtalkGtalkExtensionsRoot in FirebaseMessaging(GtalkExtensions.pbobjc.o) "_OBJC_METACLASS_$_GPBRootObject", referenced from: _OBJC_METACLASS_$_GtalkGtalkCoreRoot in FirebaseMessaging(GtalkCore.pbobjc.o) _OBJC_METACLASS_$_GtalkGtalkExtensionsRoot in FirebaseMessaging(GtalkExtensions.pbobjc.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have finally solved the issue but i will leave the upper comment so people would know what to do if they are in this situation.

Mainly if you are going to add FirebaseMessaging.framework you will need these combination of different frameworks with it. Without them you will have linker error

Firebase.framework
FirebaseCore.framework
FirebaseInstanceID.framework
GoogleUtilities.framework
Protobuf.framework

Nothing else. Good luck 馃憤

Thanks for posting your journey @keegho.

From the first line at https://github.com/firebase/firebase-ios-sdk/blob/master/Carthage.md#carthage-usage:

Note that FirebaseAnalyticsBinary must always be included.

We're happy to accept suggestions or PRs to make the process and instructions better.

@paulb777 Yes i read it and we all read it but after including FirebaseAnalyticsBinary plus other dependencies in the cartfile we really have no clue which frameworks belongs to the FirebaseAnalyticsBinary because they are all in the same folder. So i think it has to be mentioned also in a way.

I have finally solved the issue but i will leave the upper comment so people would know what to do if they are in this situation.

Mainly if you are going to add FirebaseMessaging.framework you will need these combination of different frameworks with it. Without them you will have linker error

Firebase.framework
FirebaseCore.framework
FirebaseInstanceID.framework
GoogleUtilities.framework
Protobuf.framework

Nothing else. Good luck 馃憤

Thanks for pointing out Protobuf.framework! I went to add FirebaseRemoteConfig.framework and didn't realize I had originally missed Protobuf or that FirbaseABTesting.framework was a required dependency.

Was this page helpful?
0 / 5 - 0 ratings