firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.56k stars 1.45k forks source link

Undefined symbols GRPC | Carthage | Firestore #7671

Closed markamccorkle closed 3 years ago

markamccorkle commented 3 years ago

Step 0: Are you in the right place?

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

Fails to build successfully. I've included adseil, GRPC-Core, leveled frameworks (All marked as do not embed and not copying any firebase frameworks in Carthage copy script). Not M1 related. (On i7 MacBook Pro)

Steps to reproduce:

What happened? How can we make the problem occur? Carthage update Build the project in Xcode This could be a description, log/console output, etc.

If you have a downloadable sample project that reproduces the bug you're reporting, you will likely receive a faster response on your issue.

Relevant Code:

Cartfile

binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebasePerformanceBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseProtobufBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseCrashlyticsBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json"

Error

Undefined symbols for architecture x86_64:
  "grpc::ByteBuffer::Dump(std::__1::vector<grpc::Slice, std::__1::allocator<grpc::Slice> >*) const", referenced from:
      firebase::firestore::remote::ByteBufferReader::ByteBufferReader(grpc::ByteBuffer const&) in FirebaseFirestore(grpc_nanopb.o)
  "grpc_impl::CompletionQueue::Shutdown()", referenced from:
      firebase::firestore::remote::Datastore::Shutdown() in FirebaseFirestore(datastore.o)
  "grpc_impl::SslCredentials(grpc_impl::SslCredentialsOptions const&)", referenced from:
      firebase::firestore::remote::(anonymous namespace)::CreateSslCredentials(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in FirebaseFirestore(grpc_connection.o)
  "grpc_impl::CompletionQueue::AsyncNextInternal(void**, bool*, gpr_timespec)", referenced from:
      firebase::firestore::remote::Datastore::PollGrpcQueue() in FirebaseFirestore(datastore.o)
  "grpc_impl::ChannelArguments::ChannelArguments()", referenced from:
      firebase::firestore::remote::GrpcConnection::CreateChannel() const in FirebaseFirestore(grpc_connection.o)
  "grpc_impl::ChannelArguments::SetInt(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
      firebase::firestore::remote::GrpcConnection::CreateChannel() const in FirebaseFirestore(grpc_connection.o)
  "grpc::g_glip", referenced from:
      grpc::GrpcLibraryCodegen::~GrpcLibraryCodegen() in FirebaseFirestore(firestore_client.o)
      grpc::GrpcLibraryCodegen::GrpcLibraryCodegen(bool) in FirebaseFirestore(datastore.o)
  "grpc_impl::ChannelArguments::SetSslTargetNameOverride(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      firebase::firestore::remote::GrpcConnection::CreateChannel() const in FirebaseFirestore(grpc_connection.o)
  "grpc_impl::CreateCustomChannelImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<grpc_impl::ChannelCredentials> const&, grpc_impl::ChannelArguments const&)", referenced from:
      firebase::firestore::remote::GrpcConnection::CreateChannel() const in FirebaseFirestore(grpc_connection.o)
  "grpc::Status::OK", referenced from:
      grpc::SerializationTraits<grpc::ByteBuffer, void>::Deserialize(grpc::ByteBuffer*, grpc::ByteBuffer*) in FirebaseFirestore(grpc_stream.o)
  "grpc_impl::Channel::GetState(bool)", referenced from:
      firebase::firestore::remote::GrpcConnection::EnsureActiveStub() in FirebaseFirestore(grpc_connection.o)
  "grpc_impl::ClientContext::TryCancel()", referenced from:
      firebase::firestore::remote::GrpcStream::Shutdown() in FirebaseFirestore(grpc_stream.o)
      firebase::firestore::remote::GrpcUnaryCall::Shutdown() in FirebaseFirestore(grpc_unary_call.o)
  "grpc_impl::ChannelArguments::~ChannelArguments()", referenced from:
      firebase::firestore::remote::GrpcConnection::CreateChannel() const in FirebaseFirestore(grpc_connection.o)
  "grpc_impl::ClientContext::~ClientContext()", referenced from:
      std::__1::unique_ptr<grpc_impl::ClientContext, std::__1::default_delete<grpc_impl::ClientContext> >::~unique_ptr() in FirebaseFirestore(grpc_connection.o)
      firebase::firestore::remote::GrpcConnection::CreateStream(absl::lts_2020_02_25::string_view, firebase::firestore::auth::Token const&, firebase::firestore::remote::GrpcStreamObserver*) in FirebaseFirestore(grpc_connection.o)
      absl::lts_2020_02_25::memory_internal::MakeUniqueResult<firebase::firestore::remote::GrpcStream>::scalar absl::lts_2020_02_25::make_unique<firebase::firestore::remote::GrpcStream, std::__1::unique_ptr<grpc_impl::ClientContext, std::__1::default_delete<grpc_impl::ClientContext> >, std::__1::unique_ptr<grpc_impl::ClientAsyncReaderWriter<grpc::ByteBuffer, grpc::ByteBuffer>, std::__1::default_delete<grpc_impl::ClientAsyncReaderWriter<grpc::ByteBuffer, grpc::ByteBuffer> > >, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>&, firebase::firestore::remote::GrpcConnection*, firebase::firestore::remote::GrpcStreamObserver*&>(std::__1::unique_ptr<grpc_impl::ClientContext, std::__1::default_delete<grpc_impl::ClientContext> >&&, std::__1::unique_ptr<grpc_impl::ClientAsyncReaderWriter<grpc::ByteBuffer, grpc::ByteBuffer>, std::__1::default_delete<grpc_impl::ClientAsyncReaderWriter<grpc::ByteBuffer, grpc::ByteBuffer> > >&&, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>&, firebase::firestore::remote::GrpcConnection*&&, firebase::firestore::remote::GrpcStreamObserver*&) in FirebaseFirestore(grpc_connection.o)
      firebase::firestore::remote::GrpcConnection::CreateUnaryCall(absl::lts_2020_02_25::string_view, firebase::firestore::auth::Token const&, grpc::ByteBuffer const&) in FirebaseFirestore(grpc_connection.o)
      absl::lts_2020_02_25::memory_internal::MakeUniqueResult<firebase::firestore::remote::GrpcUnaryCall>::scalar absl::lts_2020_02_25::make_unique<firebase::firestore::remote::GrpcUnaryCall, std::__1::unique_ptr<grpc_impl::ClientContext, std::__1::default_delete<grpc_impl::ClientContext> >, std::__1::unique_ptr<grpc_impl::ClientAsyncResponseReader<grpc::ByteBuffer>, std::__1::default_delete<grpc_impl::ClientAsyncResponseReader<grpc::ByteBuffer> > >, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>&, firebase::firestore::remote::GrpcConnection*, grpc::ByteBuffer const&>(std::__1::unique_ptr<grpc_impl::ClientContext, std::__1::default_delete<grpc_impl::ClientContext> >&&, std::__1::unique_ptr<grpc_impl::ClientAsyncResponseReader<grpc::ByteBuffer>, std::__1::default_delete<grpc_impl::ClientAsyncResponseReader<grpc::ByteBuffer> > >&&, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>&, firebase::firestore::remote::GrpcConnection*&&, grpc::ByteBuffer const&) in FirebaseFirestore(grpc_connection.o)
      firebase::firestore::remote::GrpcConnection::CreateStreamingReader(absl::lts_2020_02_25::string_view, firebase::firestore::auth::Token const&, grpc::ByteBuffer const&) in FirebaseFirestore(grpc_connection.o)
      absl::lts_2020_02_25::memory_internal::MakeUniqueResult<firebase::firestore::remote::GrpcStreamingReader>::scalar absl::lts_2020_02_25::make_unique<firebase::firestore::remote::GrpcStreamingReader, std::__1::unique_ptr<grpc_impl::ClientContext, std::__1::default_delete<grpc_impl::ClientContext> >, std::__1::unique_ptr<grpc_impl::ClientAsyncReaderWriter<grpc::ByteBuffer, grpc::ByteBuffer>, std::__1::default_delete<grpc_impl::ClientAsyncReaderWriter<grpc::ByteBuffer, grpc::ByteBuffer> > >, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>&, firebase::firestore::remote::GrpcConnection*, grpc::ByteBuffer const&>(std::__1::unique_ptr<grpc_impl::ClientContext, std::__1::default_delete<grpc_impl::ClientContext> >&&, std::__1::unique_ptr<grpc_impl::ClientAsyncReaderWriter<grpc::ByteBuffer, grpc::ByteBuffer>, std::__1::default_delete<grpc_impl::ClientAsyncReaderWriter<grpc::ByteBuffer, grpc::ByteBuffer> > >&&, std::__1::shared_ptr<firebase::firestore::util::AsyncQueue>&, firebase::firestore::remote::GrpcConnection*&&, grpc::ByteBuffer const&) in FirebaseFirestore(grpc_connection.o)
      ...
  "grpc_impl::ClientContext::ClientContext()", referenced from:
      absl::lts_2020_02_25::memory_internal::MakeUniqueResult<grpc_impl::ClientContext>::scalar absl::lts_2020_02_25::make_unique<grpc_impl::ClientContext>() in FirebaseFirestore(grpc_connection.o)
  "grpc::Version()", referenced from:
      firebase::firestore::remote::GrpcConnection::CreateContext(firebase::firestore::auth::Token const&) const in FirebaseFirestore(grpc_connection.o)
  "grpc_impl::InsecureChannelCredentials()", referenced from:
      firebase::firestore::remote::GrpcConnection::CreateChannel() const in FirebaseFirestore(grpc_connection.o)
  "grpc_impl::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_impl::ClientContext&) in FirebaseFirestore(firebase_metadata_provider_apple.o)
      firebase::firestore::remote::GrpcConnection::CreateContext(firebase::firestore::auth::Token const&) const in FirebaseFirestore(grpc_connection.o)
  "grpc::g_core_codegen_interface", referenced from:
      grpc_impl::CompletionQueue::~CompletionQueue() in FirebaseFirestore(firestore_client.o)
      grpc::internal::Mutex::~Mutex() in FirebaseFirestore(firestore_client.o)
      grpc::GrpcLibraryCodegen::~GrpcLibraryCodegen() in FirebaseFirestore(firestore_client.o)
      grpc_impl::internal::ClientAsyncReaderWriterFactory<grpc::ByteBuffer, grpc::ByteBuffer>::Create(grpc::ChannelInterface*, grpc_impl::CompletionQueue*, grpc::internal::RpcMethod const&, grpc_impl::ClientContext*, bool, void*) in FirebaseFirestore(grpc_connection.o)
      grpc_impl::ClientAsyncReaderWriter<grpc::ByteBuffer, grpc::ByteBuffer>::ClientAsyncReaderWriter(grpc::internal::Call, grpc_impl::ClientContext*, bool, void*) in FirebaseFirestore(grpc_connection.o)
      grpc_impl::ClientAsyncReaderWriter<grpc::ByteBuffer, grpc::ByteBuffer>::ReadInitialMetadata(void*) in FirebaseFirestore(grpc_connection.o)
      grpc_impl::ClientAsyncReaderWriter<grpc::ByteBuffer, grpc::ByteBuffer>::WritesDone(void*) in FirebaseFirestore(grpc_connection.o)
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
paulb777 commented 3 years ago

Please make sure that all frameworks included in the FirebaseFirestoreBinary downloaded are linked into the app.

markamccorkle commented 3 years ago

I've gone into the map and made sure these are added. To confirm, you're referring to the ones below, correct?

module.modulemap

framework module FirebaseFirestore {
umbrella header "FirebaseFirestore.h"
export *
module * { export * }
  link framework "CoreTelephony"
  link framework "Foundation"
  link framework "SystemConfiguration"
  link framework "UIKit"
  link "c++"
  link "z"
}
paulb777 commented 3 years ago

I'm referring to the frameworks downloaded by Carthage from https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json

markamccorkle commented 3 years ago

BINGO. Thank you!!! (also, it's building fine on my Apple M1 now as well) For anyone else's reference. These all need included.

gRPC-C++.framework
abseil.framework
leveldb.framework
BoringSSL-GRPC.framework
FirebaseFirestore.framework
gRPC-Core.framework