Firebase-ios-sdk: Can't build an app against iPhone (arm64) via Xcode

Created on 17 Nov 2018  路  4Comments  路  Source: firebase/firebase-ios-sdk

  • Xcode version: 10.1
  • Firebase SDK version: I'm using Cocoapods to install Firebase components. See below.
  • Firebase Component: See below.
  • Component version: See below.
    pod 'GoogleMobileAdsMediationFacebook'
    pod 'Fabric'
    pod 'Crashlytics'
    pod 'Firebase/Core', '5.12.0'
    pod 'Firebase/AdMob'
    pod 'Firebase/Messaging'
    pod 'Firebase/Functions'
    pod 'Firebase/RemoteConfig'
    pod 'Firebase/Performance'

Steps to reproduce:

  • Connect iPhone to MacBook and try to install an app against it. Then I get an error as follows.

    • It can build against emulator and archive against Generic iOS Device.

    • I checked each value in Build Active Architecture Only but it doesn't change the result.

Error message

Undefined symbols for architecture arm64:
  "___ubsan_handle_sub_overflow", referenced from:
      -[FIRMessagingConnection willProcessProto:] in FirebaseMessaging(FIRMessagingConnection.o)
      -[FIRMessagingDelayedMessageQueue scheduleTimeoutInMillis:] in FirebaseMessaging(FIRMessagingDelayedMessageQueue.o)
      -[FIRMessagingDataMessageManager sendDelayedMessages:] in FirebaseMessaging(FIRMessagingDataMessageManager.o)
  "___ubsan_handle_nonnull_arg", referenced from:
      -[FIRMessagingPendingTopicsList addOperationForTopic:withAction:completion:] in FirebaseMessaging(FIRMessagingPendingTopicsList.o)
      ___65-[FIRMessagingPendingTopicsList beginUpdateForCurrentBatchTopic:]_block_invoke in FirebaseMessaging(FIRMessagingPendingTopicsList.o)
      ___65-[FIRMessagingPendingTopicsList beginUpdateForCurrentBatchTopic:]_block_invoke_2 in FirebaseMessaging(FIRMessagingPendingTopicsList.o)
  "___ubsan_handle_shift_out_of_bounds", referenced from:
      -[FIRMessagingCodedInputStream readLength:] in FirebaseMessaging(FIRMessagingCodedInputStream.o)
      -[FIRMessagingClient nextRetryInterval] in FirebaseMessaging(FIRMessagingClient.o)
  "___ubsan_handle_float_cast_overflow", referenced from:
      -[FIRMessagingDelayedMessageQueue calculateTimeoutInMillisWithDelayInSeconds:] in FirebaseMessaging(FIRMessagingDelayedMessageQueue.o)
      _FIRMessagingCurrentTimestampInSeconds in FirebaseMessaging(FIRMessagingUtilities.o)
      _FIRMessagingCurrentTimestampInMilliseconds in FirebaseMessaging(FIRMessagingUtilities.o)
      _FIRMessagingGetFreeDiskSpaceInMB in FirebaseMessaging(FIRMessagingUtilities.o)
  "___ubsan_handle_add_overflow", referenced from:
      -[FIRMessagingConnection willProcessProto:] in FirebaseMessaging(FIRMessagingConnection.o)
      -[FIRMessagingConnection willSendProto:] in FirebaseMessaging(FIRMessagingConnection.o)
      -[FIRMessagingDelayedMessageQueue queueMessage:] in FirebaseMessaging(FIRMessagingDelayedMessageQueue.o)
      -[FIRMessagingDataMessageManager handleExpirationForDataMessage:] in FirebaseMessaging(FIRMessagingDataMessageManager.o)
      +[FIRMessagingReceiver nextMessageID] in FirebaseMessaging(FIRMessagingReceiver.o)
      -[FIRMessagingRmqManager loadInitialOutgoingPersistentId] in FirebaseMessaging(FIRMessagingRmqManager.o)
      -[FIRMessagingRmqManager removeRmqMessagesWithRmqIds:] in FirebaseMessaging(FIRMessagingRmqManager.o)
      ...
  "___ubsan_handle_pointer_overflow", referenced from:
      _ReadRawByte in FirebaseMessaging(FIRMessagingCodedInputStream.o)
      -[FIRMessagingSecureSocket performRead] in FirebaseMessaging(FIRMessagingSecureSocket.o)
  "___ubsan_handle_load_invalid_value", referenced from:
      -[FIRApp isDefaultApp] in FirebaseCore(FIRApp.o)
      _FIRIsLoggableLevel in FirebaseCore(FIRLogger.o)
      _FIRLogBasic in FirebaseCore(FIRLogger.o)
      -[FIROptions usingOptionsFromDefaultPlist] in FirebaseCore(FIROptions.o)
      -[FIROptions isEditingLocked] in FirebaseCore(FIROptions.o)
      -[FIRComponentContainer instantiateInstanceForProtocol:withBlock:] in FirebaseCore(FIRComponentContainer.o)
      -[FIRDependency isRequired] in FirebaseCore(FIRDependency.o)
      ...
  "___ubsan_handle_negate_overflow", referenced from:
      -[FIRMessagingConnection logMessage:messageType:isOut:] in FirebaseMessaging(FIRMessagingConnection.o)
  "___ubsan_handle_type_mismatch_v1", referenced from:
      -[FIRApp initInstanceWithName:options:] in FirebaseCore(FIRApp.o)
      -[FIRApp getTokenForcingRefresh:withCallback:] in FirebaseCore(FIRApp.o)
      -[FIRApp configureCore] in FirebaseCore(FIRApp.o)
      -[FIRApp options] in FirebaseCore(FIRApp.o)
      -[FIRApp getUID] in FirebaseCore(FIRApp.o)
      -[FIRApp isAppIDValid] in FirebaseCore(FIRApp.o)
      -[FIRApp expectedBundleID] in FirebaseCore(FIRApp.o)
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Most helpful comment

@paulb777 Thanks for responding quickly and yes that's the root cause! For some reason, that check box was grayed out so I edited xcscheme file directly and it worked finally.

All 4 comments

Looks to be something related to the Undefined Behavior Sanitizer. Does turning it off in the scheme make a difference?

screen shot 2018-11-17 at 7 43 14 am

@paulb777 Thanks for responding quickly and yes that's the root cause! For some reason, that check box was grayed out so I edited xcscheme file directly and it worked finally.

Why this issue is closed? What if I need Undefined Behavior Sanitizer on my device? Doesn't look like a fix

@Aranoledur The issue was resolved for the original poster and there was not enough detail posted for a deeper investigation. If the Undefined Behavior Sanitizer is not working for you with Firebase, please open another issue with enough detail to reproduce.

Was this page helpful?
0 / 5 - 0 ratings