Unity exported game with Google Signin, FireStore & FB SDKs build failing for iOS

Hi, I have a unity game which i am trying to export to iOS. The build was working fine until i had to integrate the following SDKs into my project.

  • Facebook SDK
  • Firebase (firestore, messaging, auth)
  • Google ads

My Xcode version is: 15.1 Build target: 12 i'm getting the following error in the logs while trying to build: Any help would be appreciated

The error is Undefined symbols and linker command failed with exit code 1 (use -v to see invocation) with output

ld: Undefined symbols:
  absl::lts_20220623::variant_internal::ThrowBadVariantAccess(), referenced from:
      firebase::firestore::nanopb::SharedMessage<firebase::firestore::_google_firestore_v1_Value>& absl::lts_20220623::variant_internal::TypedThrowBadVariantAccess<firebase::firestore::nanopb::SharedMessage<firebase::firestore::_google_firestore_v1_Value>&>() in libFirebaseCppFirestore.a[arm64][37](field_value_main.cc.o)
      firebase::firestore::DocumentReference const& absl::lts_20220623::variant_internal::TypedThrowBadVariantAccess<firebase::firestore::DocumentReference const&>() in libFirebaseCppFirestore.a[arm64][37](field_value_main.cc.o)
      std::__1::vector<firebase::firestore::FieldValue, std::__1::allocator<firebase::firestore::FieldValue>> const& absl::lts_20220623::variant_internal::TypedThrowBadVariantAccess<std::__1::vector<firebase::firestore::FieldValue, std::__1::allocator<firebase::firestore::FieldValue>> const&>() in libFirebaseCppFirestore.a[arm64][37](field_value_main.cc.o)
      std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, firebase::firestore::FieldValue, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const, firebase::firestore::FieldValue>>> const& absl::lts_20220623::variant_internal::TypedThrowBadVariantAccess<std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, firebase::firestore::FieldValue, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const, firebase::firestore::FieldValue>>> const&>() in libFirebaseCppFirestore.a[arm64][37](field_value_main.cc.o)
      firebase::firestore::nanopb::SharedMessage<firebase::firestore::_google_firestore_v1_Value> const& absl::lts_20220623::variant_internal::TypedThrowBadVariantAccess<firebase::firestore::nanopb::SharedMessage<firebase::firestore::_google_firestore_v1_Value> const&>() in libFirebaseCppFirestore.a[arm64][37](field_value_main.cc.o)
  absl::lts_20220623::optional_internal::throw_bad_optional_access(), referenced from:
      absl::lts_20220623::optional<firebase::firestore::_google_firestore_v1_Value>::value() && in libFirebaseCppFirestore.a[arm64][35](document_snapshot_main.cc.o)
      absl::lts_20220623::optional<firebase::firestore::model::Document>::value() const & in libFirebaseCppFirestore.a[arm64][40](query_main.cc.o)
      absl::lts_20220623::optional<std::__1::vector<firebase::firestore::DocumentChange, std::__1::allocator<firebase::firestore::DocumentChange>>>::value() & in libFirebaseCppFirestore.a[arm64][41](query_snapshot_main.cc.o)
      absl::lts_20220623::optional<std::__1::vector<firebase::firestore::DocumentSnapshot, std::__1::allocator<firebase::firestore::DocumentSnapshot>>>::value() & in libFirebaseCppFirestore.a[arm64][41](query_snapshot_main.cc.o)
      absl::lts_20220623::optional<std::__1::unordered_set<firebase::firestore::FieldPath, std::__1::hash<firebase::firestore::FieldPath>, std::__1::equal_to<firebase::firestore::FieldPath>, std::__1::allocator<firebase::firestore::FieldPath>>>::value() const & in libFirebaseCppFirestore.a[arm64][43](user_data_converter_main.cc.o)
  firebase::firestore::api::AggregateQuery::Get(std::__1::function<void (firebase::firestore::util::StatusOr<long long> const&)>&&), referenced from:
      firebase::firestore::AggregateQueryInternal::Get(firebase::firestore::AggregateSource) in libFirebaseCppFirestore.a[arm64][29](aggregate_query_main.cc.o)
  firebase::firestore::api::operator==(firebase::firestore::api::AggregateQuery const&, firebase::firestore::api::AggregateQuery const&), referenced from:
      firebase::firestore::operator==(firebase::firestore::AggregateQueryInternal const&, firebase::firestore::AggregateQueryInternal const&) in libFirebaseCppFirestore.a[arm64][29](aggregate_query_main.cc.o)
      firebase::firestore::operator==(firebase::firestore::AggregateQuerySnapshotInternal const&, firebase::firestore::AggregateQuerySnapshotInternal const&) in libFirebaseCppFirestore.a[arm64][30](aggregate_query_snapshot_main.cc.o)
  firebase::firestore::api::Query::Count() const, referenced from:
      firebase::firestore::QueryInternal::Count() in libFirebaseCppFirestore.a[arm64][40](query_main.cc.o)
  firebase::firestore::core::Query::normalized_order_bys() const, referenced from:
      firebase::firestore::QueryInternal::ToBound(firebase::firestore::QueryInternal::BoundPosition, firebase::firestore::DocumentSnapshot const&) const in libFirebaseCppFirestore.a[arm64][40](query_main.cc.o)
      firebase::firestore::QueryInternal::ToBound(firebase::firestore::QueryInternal::BoundPosition, firebase::firestore::DocumentSnapshot const&) const in libFirebaseCppFirestore.a[arm64][40](query_main.cc.o)
      firebase::firestore::QueryInternal::ToBound(firebase::firestore::QueryInternal::BoundPosition, firebase::firestore::DocumentSnapshot const&) const in libFirebaseCppFirestore.a[arm64][40](query_main.cc.o)
  vtable for firebase::firestore::api::AggregateQuery, referenced from:
      firebase::firestore::api::AggregateQuery::AggregateQuery(firebase::firestore::api::AggregateQuery const&) in libFirebaseCppFirestore.a[arm64][2](aggregate_query.cc.o)
      firebase::firestore::api::AggregateQuery::~AggregateQuery() in libFirebaseCppFirestore.a[arm64][2](aggregate_query.cc.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Replies

This indicates that the linker is unable to find a bunch of symbols associated with your third-party tooling. In general, the way you fix problems like this is to add the library (or stub library) that includes those symbols to the Link Binary with Libraries build phase of your target. However, these are not Apple symbols so it’s hard to say what libraries you need to add here, or indeed whether that’s the right option in general.

I recommend that you escalate this with the support resources for the third-party tools you’re using.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

hey there! have gotten a solution to this issue yet? Im in a similar situation and I have these same errors The build fails in the final Linking frameworks part towards the end of the build pipeline

I'm getting the same error with Firebase Analytics/Auth/FireStore/Storage. I'm also using Xcode 15.1, Build Target: 12, Unity 2022.3.22, Firebase SDK 11.8. I can't find any details elsewhere on this, so would love to know if anyone has resolved.

  • I am having same situation with Firebase SDK 11.8

  • I am on Unity 2021.3.x

Add a Comment

I also got the same error with firebase unity sdk 11.8.0. i removed the firebase library from the Unity Project and installed 11.6.0 and the problem was solved.

We're also having this issue. It seems to be the same bug as discussed in the Firebase Unity SDK issue tracker here: https://github.com/firebase/firebase-unity-sdk/issues/916

Hi

we are facing the same issue as below:

We received an email from Apple requesting builds using the iOS 17 SDK or later (due date mid-April), so we proceeded accordingly. However, after upgrading to MacOS Sonoma 14.4 and Xcode 15.3, we encountered several crashes on devices running iOS 17.3 and 17.4.

To address this issue, we upgraded to Firebase SDK version 11.8.0, previously we were using version 11.6.0. Initially, this resolved the issue, and we were able to successfully build for a couple of days.

However, today, when attempting to create another build, we encountered the attached errors and are unable to proceed further with the build process. We attempted to downgrade to version 11.7.0, but encountered the same error with that version as well.

would you please give advice or help in getting out of this?

There's a workaround posted by the Firebase developers in their forum: https://github.com/firebase/firebase-unity-sdk/issues/974#issuecomment-2024127530 That fixes the issue for me.

  • Thanks for sharing.

Add a Comment