Skip to content

Tests doesn't build due to Firebase linking error #14576

Open
@geolhv

Description

@geolhv

Description

When running the main app test target with firebaseanalytics added in a swift package we get the following error.

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_GULAppDelegateSwizzler", referenced from:
       in GoogleAppMeasurement[arm64][7](APMAnalytics.o)
  "_OBJC_CLASS_$_GULMutableDictionary", referenced from:
       in GoogleAppMeasurement[arm64][35](APMEExperiment.o)
  "_OBJC_CLASS_$_GULNetwork", referenced from:
       in GoogleAppMeasurement[arm64][7](APMAnalytics.o)
  "_OBJC_CLASS_$_GULSwizzler", referenced from:
       in GoogleAppMeasurement[arm64][335](UIViewController+APMScreenClassName.o)
  "_kGULNetworkHTTPStatusCodeCannotAcceptTraffic", referenced from:
      -[APMETaskManager handleFetchingExperimentsResponse:data:error:] in GoogleAppMeasurement[arm64][42](APMETaskManager.o)
      -[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
  "_kGULNetworkHTTPStatusCodeNotFound", referenced from:
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
  "_kGULNetworkHTTPStatusCodeNotModified", referenced from:
      ___37-[APMMeasurement retrievePSMResponse]_block_invoke in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement(SKAN) handleSKANFetchResponse:data:error:] in GoogleAppMeasurement[arm64][67](APMMeasurement+SKAN.o)
      ___46-[APMMeasurement(URL) requestDeferredDeepLink]_block_invoke in GoogleAppMeasurement[arm64][68](APMMeasurement+URL.o)
  "_kGULNetworkHTTPStatusCodeUnavailable", referenced from:
      -[APMETaskManager handleFetchingExperimentsResponse:data:error:] in GoogleAppMeasurement[arm64][42](APMETaskManager.o)
      -[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
  "_kGULNetworkHTTPStatusNoContent", referenced from:
      -[APMETaskManager handleFetchingExperimentsResponse:data:error:] in GoogleAppMeasurement[arm64][42](APMETaskManager.o)
      -[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      ___37-[APMMeasurement retrievePSMResponse]_block_invoke in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      ___46-[APMMeasurement(URL) requestDeferredDeepLink]_block_invoke in GoogleAppMeasurement[arm64][68](APMMeasurement+URL.o)
  "_kGULNetworkHTTPStatusOK", referenced from:
      -[APMETaskManager handleFetchingExperimentsResponse:data:error:] in GoogleAppMeasurement[arm64][42](APMETaskManager.o)
      -[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      ___37-[APMMeasurement retrievePSMResponse]_block_invoke in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement(SKAN) handleSKANFetchResponse:data:error:] in GoogleAppMeasurement[arm64][67](APMMeasurement+SKAN.o)
      ___46-[APMMeasurement(URL) requestDeferredDeepLink]_block_invoke in GoogleAppMeasurement[arm64][68](APMMeasurement+URL.o)
  "_pb_decode", referenced from:
      _apmpb_decode_ad_campaign_info in GoogleAppMeasurement[arm64][79](apmpb_ad_campaign_info_decoder.o)
      _apmpb_decode_app_property in GoogleAppMeasurement[arm64][82](apmpb_app_property_decoder.o)
      _apmpb_decode_audience in GoogleAppMeasurement[arm64][85](apmpb_audience_decoder.o)
      _apmpb_decode_audience in GoogleAppMeasurement[arm64][85](apmpb_audience_decoder.o)
      _apmpb_decode_audience_leaf_filter_result in GoogleAppMeasurement[arm64][88](apmpb_audience_leaf_filter_result_decoder.o)
      _apmpb_decode_audience_leaf_filter_result in GoogleAppMeasurement[arm64][88](apmpb_audience_leaf_filter_result_decoder.o)
      _apmpb_decode_client_property in GoogleAppMeasurement[arm64][91](apmpb_client_property_decoder.o)
      _apmpb_decode_client_property in GoogleAppMeasurement[arm64][91](apmpb_client_property_decoder.o)
      ...
  "_pb_decode_varint", referenced from:
      _nano_decode_repeated_uint64 in GoogleAppMeasurement[arm64][320](decoder_common.o)
  "_pb_encode", referenced from:
      _nano_two_pass_encoding in GoogleAppMeasurement[arm64][321](encoder_common.o)
      _nano_two_pass_encoding in GoogleAppMeasurement[arm64][321](encoder_common.o)
  "_pb_encode_string", referenced from:
      _nano_encode_string in GoogleAppMeasurement[arm64][321](encoder_common.o)
  "_pb_encode_submessage", referenced from:
      _apmpb_encode_repeated_ad_campaign_info in GoogleAppMeasurement[arm64][80](apmpb_ad_campaign_info_encoder.o)
      _apmpb_encode_repeated_app_property in GoogleAppMeasurement[arm64][83](apmpb_app_property_encoder.o)
      _apmpb_encode_repeated_audience in GoogleAppMeasurement[arm64][86](apmpb_audience_encoder.o)
      _apmpb_encode_repeated_audience_leaf_filter_result in GoogleAppMeasurement[arm64][89](apmpb_audience_leaf_filter_result_encoder.o)
      _apmpb_encode_repeated_client_property in GoogleAppMeasurement[arm64][92](apmpb_client_property_encoder.o)
      _apmpb_encode_repeated_consent_config in GoogleAppMeasurement[arm64][95](apmpb_consent_config_encoder.o)
      _apmpb_encode_repeated_consent_default_entry in GoogleAppMeasurement[arm64][98](apmpb_consent_default_entry_encoder.o)
      ...
  "_pb_encode_tag_for_field", referenced from:
      _apmpb_encode_repeated_ad_campaign_info in GoogleAppMeasurement[arm64][80](apmpb_ad_campaign_info_encoder.o)
      _apmpb_encode_repeated_app_property in GoogleAppMeasurement[arm64][83](apmpb_app_property_encoder.o)
      _apmpb_encode_repeated_audience in GoogleAppMeasurement[arm64][86](apmpb_audience_encoder.o)
      _apmpb_encode_repeated_audience_leaf_filter_result in GoogleAppMeasurement[arm64][89](apmpb_audience_leaf_filter_result_encoder.o)
      _apmpb_encode_repeated_client_property in GoogleAppMeasurement[arm64][92](apmpb_client_property_encoder.o)
      _apmpb_encode_repeated_consent_config in GoogleAppMeasurement[arm64][95](apmpb_consent_config_encoder.o)
      _apmpb_encode_repeated_consent_default_entry in GoogleAppMeasurement[arm64][98](apmpb_consent_default_entry_encoder.o)
      ...
  "_pb_encode_varint", referenced from:
      _nano_encode_repeated_uint64 in GoogleAppMeasurement[arm64][321](encoder_common.o)
  "_pb_istream_from_buffer", referenced from:
      _apmpb_decode_ad_campaign_info in GoogleAppMeasurement[arm64][79](apmpb_ad_campaign_info_decoder.o)
      _apmpb_decode_app_property in GoogleAppMeasurement[arm64][82](apmpb_app_property_decoder.o)
      _apmpb_decode_audience in GoogleAppMeasurement[arm64][85](apmpb_audience_decoder.o)
      _apmpb_decode_audience in GoogleAppMeasurement[arm64][85](apmpb_audience_decoder.o)
      _apmpb_decode_audience_leaf_filter_result in GoogleAppMeasurement[arm64][88](apmpb_audience_leaf_filter_result_decoder.o)
      _apmpb_decode_audience_leaf_filter_result in GoogleAppMeasurement[arm64][88](apmpb_audience_leaf_filter_result_decoder.o)
      _apmpb_decode_client_property in GoogleAppMeasurement[arm64][91](apmpb_client_property_decoder.o)
      _apmpb_decode_client_property in GoogleAppMeasurement[arm64][91](apmpb_client_property_decoder.o)
      ...
  "_pb_ostream_from_buffer", referenced from:
      _nano_two_pass_encoding in GoogleAppMeasurement[arm64][321](encoder_common.o)
  "_pb_read", referenced from:
      _apmpb_decode_repeated_ad_campaign_info in GoogleAppMeasurement[arm64][79](apmpb_ad_campaign_info_decoder.o)
      _apmpb_decode_repeated_ad_campaign_info in GoogleAppMeasurement[arm64][79](apmpb_ad_campaign_info_decoder.o)
      _apmpb_decode_repeated_app_property in GoogleAppMeasurement[arm64][82](apmpb_app_property_decoder.o)
      _apmpb_decode_repeated_app_property in GoogleAppMeasurement[arm64][82](apmpb_app_property_decoder.o)
      _apmpb_decode_repeated_audience in GoogleAppMeasurement[arm64][85](apmpb_audience_decoder.o)
      _apmpb_decode_repeated_audience in GoogleAppMeasurement[arm64][85](apmpb_audience_decoder.o)
      _apmpb_decode_repeated_audience_leaf_filter_result in GoogleAppMeasurement[arm64][88](apmpb_audience_leaf_filter_result_decoder.o)
      _apmpb_decode_repeated_audience_leaf_filter_result in GoogleAppMeasurement[arm64][88](apmpb_audience_leaf_filter_result_decoder.o)
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Reproducing the issue

In an Xcode project:

  • Create multiple packages (Package1, Package2)
  • Make one of packages use firebase analytics which means adding firebase as a dependency
  • Add all packages in the main app target
  • Add a test target to the main app
  • Add a test-plan to the main app scheme that then runs the test target

Firebase SDK Version

11.8.1

Xcode Version

16.2

Installation Method

Swift Package Manager

Firebase Product(s)

Analytics

Targeted Platforms

iOS

Relevant Log Output

/Users/georgequentin/Desktop/Screenshot 2025-03-13 at 22.17.21.png

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_GULAppDelegateSwizzler", referenced from:
       in GoogleAppMeasurement[arm64][7](APMAnalytics.o)
  "_OBJC_CLASS_$_GULMutableDictionary", referenced from:
       in GoogleAppMeasurement[arm64][35](APMEExperiment.o)
  "_OBJC_CLASS_$_GULNetwork", referenced from:
       in GoogleAppMeasurement[arm64][7](APMAnalytics.o)
  "_OBJC_CLASS_$_GULSwizzler", referenced from:
       in GoogleAppMeasurement[arm64][335](UIViewController+APMScreenClassName.o)
  "_kGULNetworkHTTPStatusCodeCannotAcceptTraffic", referenced from:
      -[APMETaskManager handleFetchingExperimentsResponse:data:error:] in GoogleAppMeasurement[arm64][42](APMETaskManager.o)
      -[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
  "_kGULNetworkHTTPStatusCodeNotFound", referenced from:
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
  "_kGULNetworkHTTPStatusCodeNotModified", referenced from:
      ___37-[APMMeasurement retrievePSMResponse]_block_invoke in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement(SKAN) handleSKANFetchResponse:data:error:] in GoogleAppMeasurement[arm64][67](APMMeasurement+SKAN.o)
      ___46-[APMMeasurement(URL) requestDeferredDeepLink]_block_invoke in GoogleAppMeasurement[arm64][68](APMMeasurement+URL.o)
  "_kGULNetworkHTTPStatusCodeUnavailable", referenced from:
      -[APMETaskManager handleFetchingExperimentsResponse:data:error:] in GoogleAppMeasurement[arm64][42](APMETaskManager.o)
      -[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
  "_kGULNetworkHTTPStatusNoContent", referenced from:
      -[APMETaskManager handleFetchingExperimentsResponse:data:error:] in GoogleAppMeasurement[arm64][42](APMETaskManager.o)
      -[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      ___37-[APMMeasurement retrievePSMResponse]_block_invoke in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      ___46-[APMMeasurement(URL) requestDeferredDeepLink]_block_invoke in GoogleAppMeasurement[arm64][68](APMMeasurement+URL.o)
  "_kGULNetworkHTTPStatusOK", referenced from:
      -[APMETaskManager handleFetchingExperimentsResponse:data:error:] in GoogleAppMeasurement[arm64][42](APMETaskManager.o)
      -[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      ___37-[APMMeasurement retrievePSMResponse]_block_invoke in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)
      -[APMMeasurement(SKAN) handleSKANFetchResponse:data:error:] in GoogleAppMeasurement[arm64][67](APMMeasurement+SKAN.o)
      ___46-[APMMeasurement(URL) requestDeferredDeepLink]_block_invoke in GoogleAppMeasurement[arm64][68](APMMeasurement+URL.o)
  "_pb_decode", referenced from:
      _apmpb_decode_ad_campaign_info in GoogleAppMeasurement[arm64][79](apmpb_ad_campaign_info_decoder.o)
      _apmpb_decode_app_property in GoogleAppMeasurement[arm64][82](apmpb_app_property_decoder.o)
      _apmpb_decode_audience in GoogleAppMeasurement[arm64][85](apmpb_audience_decoder.o)
      _apmpb_decode_audience in GoogleAppMeasurement[arm64][85](apmpb_audience_decoder.o)
      _apmpb_decode_audience_leaf_filter_result in GoogleAppMeasurement[arm64][88](apmpb_audience_leaf_filter_result_decoder.o)
      _apmpb_decode_audience_leaf_filter_result in GoogleAppMeasurement[arm64][88](apmpb_audience_leaf_filter_result_decoder.o)
      _apmpb_decode_client_property in GoogleAppMeasurement[arm64][91](apmpb_client_property_decoder.o)
      _apmpb_decode_client_property in GoogleAppMeasurement[arm64][91](apmpb_client_property_decoder.o)
      ...
  "_pb_decode_varint", referenced from:
      _nano_decode_repeated_uint64 in GoogleAppMeasurement[arm64][320](decoder_common.o)
  "_pb_encode", referenced from:
      _nano_two_pass_encoding in GoogleAppMeasurement[arm64][321](encoder_common.o)
      _nano_two_pass_encoding in GoogleAppMeasurement[arm64][321](encoder_common.o)
  "_pb_encode_string", referenced from:
      _nano_encode_string in GoogleAppMeasurement[arm64][321](encoder_common.o)
  "_pb_encode_submessage", referenced from:
      _apmpb_encode_repeated_ad_campaign_info in GoogleAppMeasurement[arm64][80](apmpb_ad_campaign_info_encoder.o)
      _apmpb_encode_repeated_app_property in GoogleAppMeasurement[arm64][83](apmpb_app_property_encoder.o)
      _apmpb_encode_repeated_audience in GoogleAppMeasurement[arm64][86](apmpb_audience_encoder.o)
      _apmpb_encode_repeated_audience_leaf_filter_result in GoogleAppMeasurement[arm64][89](apmpb_audience_leaf_filter_result_encoder.o)
      _apmpb_encode_repeated_client_property in GoogleAppMeasurement[arm64][92](apmpb_client_property_encoder.o)
      _apmpb_encode_repeated_consent_config in GoogleAppMeasurement[arm64][95](apmpb_consent_config_encoder.o)
      _apmpb_encode_repeated_consent_default_entry in GoogleAppMeasurement[arm64][98](apmpb_consent_default_entry_encoder.o)
      ...
  "_pb_encode_tag_for_field", referenced from:
      _apmpb_encode_repeated_ad_campaign_info in GoogleAppMeasurement[arm64][80](apmpb_ad_campaign_info_encoder.o)
      _apmpb_encode_repeated_app_property in GoogleAppMeasurement[arm64][83](apmpb_app_property_encoder.o)
      _apmpb_encode_repeated_audience in GoogleAppMeasurement[arm64][86](apmpb_audience_encoder.o)
      _apmpb_encode_repeated_audience_leaf_filter_result in GoogleAppMeasurement[arm64][89](apmpb_audience_leaf_filter_result_encoder.o)
      _apmpb_encode_repeated_client_property in GoogleAppMeasurement[arm64][92](apmpb_client_property_encoder.o)
      _apmpb_encode_repeated_consent_config in GoogleAppMeasurement[arm64][95](apmpb_consent_config_encoder.o)
      _apmpb_encode_repeated_consent_default_entry in GoogleAppMeasurement[arm64][98](apmpb_consent_default_entry_encoder.o)
      ...
  "_pb_encode_varint", referenced from:
      _nano_encode_repeated_uint64 in GoogleAppMeasurement[arm64][321](encoder_common.o)
  "_pb_istream_from_buffer", referenced from:
      _apmpb_decode_ad_campaign_info in GoogleAppMeasurement[arm64][79](apmpb_ad_campaign_info_decoder.o)
      _apmpb_decode_app_property in GoogleAppMeasurement[arm64][82](apmpb_app_property_decoder.o)
      _apmpb_decode_audience in GoogleAppMeasurement[arm64][85](apmpb_audience_decoder.o)
      _apmpb_decode_audience in GoogleAppMeasurement[arm64][85](apmpb_audience_decoder.o)
      _apmpb_decode_audience_leaf_filter_result in GoogleAppMeasurement[arm64][88](apmpb_audience_leaf_filter_result_decoder.o)
      _apmpb_decode_audience_leaf_filter_result in GoogleAppMeasurement[arm64][88](apmpb_audience_leaf_filter_result_decoder.o)
      _apmpb_decode_client_property in GoogleAppMeasurement[arm64][91](apmpb_client_property_decoder.o)
      _apmpb_decode_client_property in GoogleAppMeasurement[arm64][91](apmpb_client_property_decoder.o)
      ...
  "_pb_ostream_from_buffer", referenced from:
      _nano_two_pass_encoding in GoogleAppMeasurement[arm64][321](encoder_common.o)
  "_pb_read", referenced from:
      _apmpb_decode_repeated_ad_campaign_info in GoogleAppMeasurement[arm64][79](apmpb_ad_campaign_info_decoder.o)
      _apmpb_decode_repeated_ad_campaign_info in GoogleAppMeasurement[arm64][79](apmpb_ad_campaign_info_decoder.o)
      _apmpb_decode_repeated_app_property in GoogleAppMeasurement[arm64][82](apmpb_app_property_decoder.o)
      _apmpb_decode_repeated_app_property in GoogleAppMeasurement[arm64][82](apmpb_app_property_decoder.o)
      _apmpb_decode_repeated_audience in GoogleAppMeasurement[arm64][85](apmpb_audience_decoder.o)
      _apmpb_decode_repeated_audience in GoogleAppMeasurement[arm64][85](apmpb_audience_decoder.o)
      _apmpb_decode_repeated_audience_leaf_filter_result in GoogleAppMeasurement[arm64][88](apmpb_audience_leaf_filter_result_decoder.o)
      _apmpb_decode_repeated_audience_leaf_filter_result in GoogleAppMeasurement[arm64][88](apmpb_audience_leaf_filter_result_decoder.o)
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
Replace this line with the contents of your Podfile.lock!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions