Description
Description
I have a large app that uses many Firebase libraries integrated by CocoaPods. I'm attempting to move to SPM, but I'm running into errors building. My app is consists of many modules (frameworks), some of which use FirebasePerformance and one which uses FirebaseFirestore. I've tried the 4 methods below, all failing:
A) I remove Firebase from CocoaPods (using pod deintegrate
and then pod install
), and then include Firebase 11.8.1 using SPM, I link my various modules to Firebase libraries, but while building I get link errors involving undefined symbol errors for many of the abseil symbols used by gRCP. At this point in during the build the frameworks are in a "PackageFrameworks" directory and Xcode is referring to the abseil framework as "abseil_1F63F2923BFCF6_PackageProduct.framework", however, in the "PackageFrameworks" there is also a "absl.framework". If I run the clang command from the command-line and including a reference to the "absl.framework", then the link will work.
There are about 100 errors, here is a sample of some of them:
Undefined symbols for architecture x86_64:
"_AbslInternalSleepFor_lts_20240116", referenced from:
grpc_event_engine::experimental::WorkStealingThreadPool::WorkStealingThreadPoolImpl::DumpStacksAndCrash() in grpc[x86_64][885](work_stealing_thread_pool.o)
grpc_event_engine::experimental::WorkStealingThreadPool::ThreadState::SleepIfRunning() in grpc[x86_64][885](work_stealing_thread_pool.o)
"absl::lts_20240116::CHexEscape(absl::lts_20240116::string_view)", referenced from:
void absl::lts_20240116::functional_internal::InvokeObject<grpc_core::StatusToString(absl::lts_20240116::Status const&)::$_0, void, absl::lts_20240116::string_view, absl::lts_20240116::Cord const&>(absl::lts_20240116::functional_internal::VoidPtr, absl::lts_20240116::functional_internal::ForwardT<absl::lts_20240116::string_view>::type, absl::lts_20240116::functional_internal::ForwardT<absl::lts_20240116::Cord const&>::type) in grpc[x86_64][737](status_helper.o)
void absl::lts_20240116::functional_internal::InvokeObject<grpc_core::StatusToString(absl::lts_20240116::Status const&)::$_0, void, absl::lts_20240116::string_view, absl::lts_20240116::Cord const&>(absl::lts_20240116::functional_internal::VoidPtr, absl::lts_20240116::functional_internal::ForwardT<absl::lts_20240116::string_view>::type, absl::lts_20240116::functional_internal::ForwardT<absl::lts_20240116::Cord const&>::type) in grpc[x86_64][737](status_helper.o)
void absl::lts_20240116::functional_internal::InvokeObject<grpc_core::StatusToString(absl::lts_20240116::Status const&)::$_0, void, absl::lts_20240116::string_view, absl::lts_20240116::Cord const&>(absl::lts_20240116::functional_internal::VoidPtr, absl::lts_20240116::functional_internal::ForwardT<absl::lts_20240116::string_view>::type, absl::lts_20240116::functional_internal::ForwardT<absl::lts_20240116::Cord const&>::type) in grpc[x86_64][737](status_helper.o)
void absl::lts_20240116::functional_internal::InvokeObject<grpc_core::StatusToString(absl::lts_20240116::Status const&)::$_0, void, absl::lts_20240116::string_view, absl::lts_20240116::Cord const&>(absl::lts_20240116::functional_internal::VoidPtr, absl::lts_20240116::functional_internal::ForwardT<absl::lts_20240116::string_view>::type, absl::lts_20240116::functional_internal::ForwardT<absl::lts_20240116::Cord const&>::type) in grpc[x86_64][737](status_helper.o)
"absl::lts_20240116::FormatTime(absl::lts_20240116::string_view, absl::lts_20240116::Time, absl::lts_20240116::TimeZone)", referenced from:
grpc_core::AwsRequestSigner::AwsRequestSigner(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>>, 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>>, 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>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::map<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>>, std::__1::less<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, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>>, absl::lts_20240116::Status*) in grpc[x86_64][55](aws_request_signer.o)
grpc_core::AwsRequestSigner::GetSignedRequestHeaders() in grpc[x86_64][55](aws_request_signer.o)
grpc_core::StatusSetTime(absl::lts_20240116::Status*, grpc_core::StatusTimeProperty, absl::lts_20240116::Time) in grpc[x86_64][737](status_helper.o)
"absl::lts_20240116::FormatTime(absl::lts_20240116::Time)", referenced from:
grpc_service_account_jwt_access_credentials::debug_string() in grpc[x86_64][440](jwt_credentials.o)
void absl::lts_20240116::functional_internal::InvokeObject<grpc_core::StatusToString(absl::lts_20240116::Status const&)::$_0, void, absl::lts_20240116::string_view, absl::lts_20240116::Cord const&>(absl::lts_20240116::functional_internal::VoidPtr, absl::lts_20240116::functional_internal::ForwardT<absl::lts_20240116::string_view>::type, absl::lts_20240116::functional_internal::ForwardT<absl::lts_20240116::Cord const&>::type) in grpc[x86_64][737](status_helper.o)
grpc_core::experimental::StdoutAuditLogger::Log(grpc_core::experimental::AuditContext const&) in grpc[x86_64][739](stdout_logger.o)
"absl::lts_20240116::IsNotFound(absl::lts_20240116::Status const&)", referenced from:
CustomVerificationFunction(x509_store_ctx_st*, void*) in grpc[x86_64][713](ssl_transport_security.o)
"absl::lts_20240116::SimpleAtod(absl::lts_20240116::string_view, double*)", referenced from:
firebase::firestore::util::JsonReader::DecodeDouble(nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer, std::__1::vector<unsigned char, std::__1::allocator<unsigned char>>> const&) in FirebaseFirestoreInternal[x86_64][121](json_reader.o)
"absl::lts_20240116::SimpleAtof(absl::lts_20240116::string_view, float*)", referenced from:
grpc_core::json_detail::LoadFloat::LoadInto(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, void*, grpc_core::ValidationErrors*) const in grpc[x86_64][878](weighted_round_robin.o)
I also tried this with Firebase 11.8.0, and 11.7.0, but I get the same error.
B) If I use Firebase 10.5.0, 10.6.0, & 10.7.0 I get a different link error:
Undefined symbols for architecture x86_64:
"___llvm_profile_runtime", referenced from:
___llvm_profile_runtime_user in openssl_grpc.o
C) If I use Firebase 10.8.1 I again get different link errors involving grpc. Here is a sample:
Undefined symbols for architecture x86_64:
"grpc::ClientContext::AddMetadata(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&)", referenced from:
firebase::firestore::remote::FirebaseMetadataProviderApple::UpdateMetadata(grpc::ClientContext&) in FirebaseFirestore[x86_64][69](firebase_metadata_provider_apple.o)
firebase::firestore::remote::FirebaseMetadataProviderApple::UpdateMetadata(grpc::ClientContext&) in FirebaseFirestore[x86_64][69](firebase_metadata_provider_apple.o)
firebase::firestore::remote::FirebaseMetadataProviderApple::UpdateMetadata(grpc::ClientContext&) in FirebaseFirestore[x86_64][69](firebase_metadata_provider_apple.o)
firebase::firestore::remote::GrpcConnection::CreateContext(firebase::firestore::credentials::AuthToken const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const in FirebaseFirestore[x86_64][99](grpc_connection.o)
firebase::firestore::remote::GrpcConnection::CreateContext(firebase::firestore::credentials::AuthToken const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const in FirebaseFirestore[x86_64][99](grpc_connection.o)
firebase::firestore::remote::GrpcConnection::CreateContext(firebase::firestore::credentials::AuthToken const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const in FirebaseFirestore[x86_64][99](grpc_connection.o)
firebase::firestore::remote::GrpcConnection::CreateContext(firebase::firestore::credentials::AuthToken const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const in FirebaseFirestore[x86_64][99](grpc_connection.o)
firebase::firestore::remote::GrpcConnection::CreateContext(firebase::firestore::credentials::AuthToken const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const in FirebaseFirestore[x86_64][99](grpc_connection.o)
D) I also tried setting the environment variable to FIREBASE_SOURCE_FIRESTORE while using Firebase 11.8.1 and I get the following error:
error: <path>/SourcePackages/checkouts/grpc-ios/src/objective-c/PrivacyInfo.xcprivacy: No such file or directory (in target 'gRPC_gRPC-cpp' from project 'gRPC')
Reproducing the issue
No response
Firebase SDK Version
11.8.1
Xcode Version
16.0
Installation Method
Swift Package Manager
Firebase Product(s)
Firestore
Targeted Platforms
iOS
Relevant Log Output
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!