1

Whenever I try to run my Unity-built project in Xcode, I get a large number of errors that look to be related to Firebase's Firestore. I do not get any errors when running with just Unity for Android on Windows.

I am using Firebase 6.15.2 and I'm trying to compile my iOS app using Xcode v11.6. The Xcode iOS project was created by Unity 2019.4.4f1 running on Windows.

Undefined symbols for architecture arm64:
  "firebase::firestore::nanopb::ByteString::ByteString(firebase::firestore::nanopb::ByteString&&)", referenced from:
      firebase::firestore::UserDataConverter::ParseScalar(firebase::firestore::FieldValue const&, firebase::firestore::core::ParseContext&&) const in libFirebaseCppFirestore.a(user_data_converter_ios_c8d050486a942078faf3c42cf8358d9f.o)
  "firebase::firestore::model::ArrayTransform::ArrayTransform(firebase::firestore::model::TransformOperation::Type, std::__1::vector<firebase::firestore::model::FieldValue, std::__1::allocator<firebase::firestore::model::FieldValue> >)", referenced from:
      firebase::firestore::UserDataConverter::ParseSentinel(firebase::firestore::FieldValue const&, firebase::firestore::core::ParseContext&&) const in libFirebaseCppFirestore.a(user_data_converter_ios_c8d050486a942078faf3c42cf8358d9f.o)
  "firebase::firestore::model::ServerTimestampTransform::ServerTimestampTransform()", referenced from:
      firebase::firestore::UserDataConverter::ParseSentinel(firebase::firestore::FieldValue const&, firebase::firestore::core::ParseContext&&) const in libFirebaseCppFirestore.a(user_data_converter_ios_c8d050486a942078faf3c42cf8358d9f.o)
  "firebase::firestore::model::NumericIncrementTransform::NumericIncrementTransform(firebase::firestore::model::FieldValue)", referenced from:
      firebase::firestore::UserDataConverter::ParseSentinel(firebase::firestore::FieldValue const&, firebase::firestore::core::ParseContext&&) const in libFirebaseCppFirestore.a(user_data_converter_ios_c8d050486a942078faf3c42cf8358d9f.o)
  "firebase::firestore::core::ParseContext::ChildContext(unsigned long)", referenced from:
      firebase::firestore::UserDataConverter::ParseArray(std::__1::vector<firebase::firestore::FieldValue, std::__1::allocator<firebase::firestore::FieldValue> > const&, firebase::firestore::core::ParseContext&&) const in libFirebaseCppFirestore.a(user_data_converter_ios_c8d050486a942078faf3c42cf8358d9f.o)
      firebase::firestore::UserDataConverter::ParseArrayTransformElements(firebase::firestore::FieldValue const&) const in libFirebaseCppFirestore.a(user_data_converter_ios_c8d050486a942078faf3c42cf8358d9f.o)
  ...
  "firebase::firestore::util::Comparator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::Compare(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
      firebase::firestore::util::ComparisonResult firebase::firestore::util::CompareContainer<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in libFirebaseCppFirestore.a(field_path_8e22025db8fd9ff2d7ac3ddb6af30a3e.o)
      firebase::firestore::util::ComparisonResult firebase::firestore::util::CompareContainer<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) in libFirebaseCppFirestore.a(user_data_converter_ios_c8d050486a942078faf3c42cf8358d9f.o)
      firebase::firestore::immutable::impl::ArraySortedMap<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, firebase::firestore::model::FieldValue, firebase::firestore::util::Comparator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::insert(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, firebase::firestore::model::FieldValue const&) const in libFirebaseCppFirestore.a(user_data_converter_ios_c8d050486a942078faf3c42cf8358d9f.o)
      firebase::firestore::immutable::impl::LlrbNode<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, firebase::firestore::model::FieldValue> firebase::firestore::immutable::impl::LlrbNode<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, firebase::firestore::model::FieldValue>::InnerInsert<firebase::firestore::util::Comparator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, firebase::firestore::model::FieldValue const&, firebase::firestore::util::Comparator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) const in libFirebaseCppFirestore.a(user_data_converter_ios_c8d050486a942078faf3c42cf8358d9f.o)
      firebase::firestore::model::FieldValue std::__1::__lower_bound<firebase::firestore::immutable::impl::ArraySortedMap<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, firebase::firestore::model::FieldValue, firebase::firestore::util::Comparator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::lower_bound(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const::'lambda'(std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, firebase::firestore::model::FieldValue> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)&, std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, firebase::firestore::model::FieldValue> const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(firebase::firestore::model::FieldValue, firebase::firestore::model::FieldValue, firebase::firestore::util::Comparator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in libFirebaseCppFirestore.a(user_data_converter_ios_c8d050486a942078faf3c42cf8358d9f.o)
  "_FIRRemoteConfigThrottledEndTimeInSecondsKey", referenced from:
      ____ZN8firebase13remote_config5FetchEy_block_invoke in libFirebaseCppRemoteConfig.a(remote_config_ios_e6d2ed559f32c182ac8412737f5fb36a.o)
      ____ZN8firebase13remote_config8internal20RemoteConfigInternal17EnsureInitializedEv_block_invoke in libFirebaseCppRemoteConfig.a(remote_config_ios_e6d2ed559f32c182ac8412737f5fb36a.o)
      long long firebase::remote_config::internal::FutureCompleteWithError<firebase::SafeFutureHandle<bool>, bool>(NSError*, firebase::ReferenceCountedFutureImpl*, firebase::SafeFutureHandle<bool>, bool) in libFirebaseCppRemoteConfig.a(remote_config_ios_e6d2ed559f32c182ac8412737f5fb36a.o)
      ____ZN8firebase13remote_config8internal20RemoteConfigInternal5FetchEy_block_invoke in libFirebaseCppRemoteConfig.a(remote_config_ios_e6d2ed559f32c182ac8412737f5fb36a.o)
  "firebase::Timestamp::Timestamp(long long, int)", referenced from:
      _Firebase_Firestore_new_TimestampInternal__SWIG_1 in libFirebaseCppFirestore.a(firestore_afa9ea7678313e4b91bb158d472a9e2c.o)
      firebase::firestore::UserDataConverter::ParseScalar(firebase::firestore::FieldValue const&, firebase::firestore::core::ParseContext&&) const in libFirebaseCppFirestore.a(user_data_converter_ios_c8d050486a942078faf3c42cf8358d9f.o)
  "firebase::firestore::GeoPoint::GeoPoint(double, double)", referenced from:
      _Firebase_Firestore_new_GeoPointInternal in libFirebaseCppFirestore.a(firestore_afa9ea7678313e4b91bb158d472a9e2c.o)
  "firebase::firestore::api::DocumentSnapshot::CreateReference() const", referenced from:
      firebase::firestore::DocumentSnapshotInternal::reference() const in libFirebaseCppFirestore.a(document_snapshot_ios_430abd732548c2f7bcba1499365c9caa.o)
  "firebase::firestore::model::FieldValue::FieldValue()", referenced from:
      firebase::firestore::FieldValue::Null() in libFirebaseCppFirestore.a(field_value_b318b937baabea572d056aefd3d9d0de.o)
      std::__1::shared_ptr<firebase::firestore::immutable::impl::FixedArray<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, firebase::firestore::model::FieldValue> > const> std::__1::shared_ptr<firebase::firestore::immutable::impl::FixedArray<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, firebase::firestore::model::FieldValue> > const>::make_shared<>() in libFirebaseCppFirestore.a(document_snapshot_ios_430abd732548c2f7bcba1499365c9caa.o)
      firebase::firestore::UserDataConverter::ParseSentinel(firebase::firestore::FieldValue const&, firebase::firestore::core::ParseContext&&) const in libFirebaseCppFirestore.a(user_data_converter_ios_c8d050486a942078faf3c42cf8358d9f.o)
      std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, firebase::firestore::model::FieldValue>::pair<true, false>() in libFirebaseCppFirestore.a(user_data_converter_ios_c8d050486a942078faf3c42cf8358d9f.o)
  "firebase::firestore::api::Firestore::GetBatch()", referenced from:
      firebase::firestore::FirestoreInternal::batch() const in libFirebaseCppFirestore.a(firestore_ios_eec52dfa6e1434eb3ea69ba309362c0c.o)
  "firebase::auth::Auth::AddAuthStateListener(firebase::auth::AuthStateListener*)", referenced from:
      firebase::firestore::FirebaseCppCredentialsProvider::SetCredentialChangeListener(std::__1::function<void (firebase::firestore::auth::User)>) in libFirebaseCppFirestore.a(credentials_provider_ios_c4b11a23b793b1dcedea6096ad99afca.o)
  "firebase::firestore::api::Firestore::GetDocument(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      firebase::firestore::FirestoreInternal::Document(char const*) const in libFirebaseCppFirestore.a(firestore_ios_eec52dfa6e1434eb3ea69ba309362c0c.o)
  "firebase::firestore::core::Transaction::MarkPermanentlyFailed()", referenced from:
      firebase::firestore::TransactionInternal::MarkPermanentlyFailed() in libFirebaseCppFirestore.a(transaction_ios_23d9210df3e403c5645ebc8e23ae5b28.o)
  "firebase::Timestamp::ToString() const", referenced from:
      _Firebase_Firestore_TimestampInternal_ToString in libFirebaseCppFirestore.a(firestore_afa9ea7678313e4b91bb158d472a9e2c.o)
      firebase::firestore::FieldValue::ToString() const in libFirebaseCppFirestore.a(field_value_b318b937baabea572d056aefd3d9d0de.o)
  "firebase::firestore::GeoPoint::ToString() const", referenced from:
      firebase::firestore::FieldValue::ToString() const in libFirebaseCppFirestore.a(field_value_b318b937baabea572d056aefd3d9d0de.o)
  "firebase::firestore::api::DocumentSnapshot::GetData() const", referenced from:
      firebase::firestore::DocumentSnapshotInternal::GetData(firebase::firestore::DocumentSnapshot::ServerTimestampBehavior) const in libFirebaseCppFirestore.a(document_snapshot_ios_430abd732548c2f7bcba1499365c9caa.o)
  "firebase::firestore::util::AsyncQueue::Create(std::__1::unique_ptr<firebase::firestore::util::Executor, std::__1::default_delete<firebase::firestore::util::Executor> >)", referenced from:
      firebase::firestore::FirestoreInternal::CreateFirestore(firebase::App*, std::__1::unique_ptr<firebase::firestore::auth::CredentialsProvider, std::__1::default_delete<firebase::firestore::auth::CredentialsProvider> >) in libFirebaseCppFirestore.a(firestore_ios_eec52dfa6e1434eb3ea69ba309362c0c.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Showing first 200 notices only

In Unity package manager, I can confirm the "Cloud Firestore for Firebase" are version 6.15.2. However, my Podfile that gets generated looks a bit weird when it says version 1.15.0. Is this the problem?

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'

target 'UnityFramework' do
  pod 'Firebase/Analytics', '6.24.0'
  pod 'Firebase/Core', '6.24.0'
  pod 'Firebase/RemoteConfig', '6.24.0'
  pod 'FirebaseCrashlytics', '4.1.0'
  pod 'FirebaseFirestore', '1.15.0'
end
Cassova
  • 530
  • 1
  • 3
  • 20
  • I think [this answer](https://stackoverflow.com/a/52051876/10810527) may be relevant, could you check it out? – Ajordat Aug 18 '20 at 15:19
  • Thanks but that doesn't seem to be it. Unity didn't generate an .xcworkspace file and a Build Clean also didn't help. – Cassova Aug 19 '20 at 23:47
  • Your comment actually does help! The missing .xcworkspace has pushed me down a rabbit hole and I'm now working on how to resolve that part. If I get answer, I'll update. – Cassova Aug 20 '20 at 02:21
  • Awesome! If you're still stuck you can update your question so we can help you further. – Ajordat Aug 20 '20 at 07:04

2 Answers2

2

At the time of writing, I still haven't got all the kinks but I wanted to post an answer that @Ajordat helped me come to find. If I run into another issue, I'll update.

I was missing a .xcworkspace file which is what I should be opening in XCode to not get the above errors. To get this missing file, I needed to run pod install from a terminal window on my Mac in the project folder.

I haven't found a way to do this part on Windows but it shouldn't be necessary since you need XCode anyway to do the final compile which only runs on Mac. That being said, I found this in case anyone is interested: Using CocoaPods on Windows

Cassova
  • 530
  • 1
  • 3
  • 20
  • 1
    This worked for me as well: the errors specifically occurred when I switched from an Intel mac to an M1. Either moving to a new mac didn't install the Pods (maybe it thought they were already installed), or it's an issue on M1 - not sure which. In either case, downloading cocoapods and running pod install creates a `.xcworkspace` which resolves the issue. – artoonie Feb 08 '22 at 21:51
-2

I believe the 1.15.0 version might gear toward Firestore in particular. Just by curiousity, does Unity works with the previous version of Firebase like Firebase 5.3.0?

Stephan
  • 155
  • 6
  • Perhaps you meant to leave a comment? You can read about Unity and Firebase support here: https://firebase.google.com/docs/unity/setup – Cassova Aug 18 '20 at 02:45