简体   繁体   中英

Firebase SDK conflicts with Facebook SDK

I followed the latest tutorial for setting up firebase SDK:

https://www.firebase.com/docs/ios/guide/setup.html

However, I found that I got a bunch of buildtime errors. When I remove the Facebook SDK, everything goes back to normal and I can use the Firebase SDK. However, I need the Facebook SDK in my app.

Can someone help with finding the reason for the conflict.

PS I followed the tutorial exactly and have a working firebase app that doesn't have Facebook

Undefined symbols for architecture arm64: "std::string::find_first_not_of(char const*, unsigned long, unsigned long) const", referenced from: MacStringUtilsPFC_::IntegerValueAtIndex(std::string&, unsigned int) in ParseCrashReporting(string_utilities.o) "std::string::find_first_of(char const*, unsigned long, unsigned long) const", referenced from: MacStringUtilsPFC_::IntegerValueAtIndex(std::string&, unsigned int) in ParseCrashReporting(string_utilities.o) "std::__throw_length_error(char const*)", referenced from: std::vector<MDMemoryDescriptor, google_breakpadPFC_::PageStdAllocator<MDMemoryDescriptor> >::_M_insert_aux(__gnu_cxx::__normal_iterator<MDMemoryDescriptor*, std::vector<MDMemoryDescriptor, google_breakpadPFC_::PageStdAllocator<MDMemoryDescriptor> > >, MDMemoryDescriptor const&) in ParseCrashReporting(minidump_generator.o) std::vector<MDMemoryDescriptor, google_breakpadPFC_::PageStdAllocator<MDMemoryDescriptor> >::reserve(unsigned long) in ParseCrashReporting(minidump_generator.o) std::vector<google_breakpadPFC_::DynamicImageRef, std::allocator<google_breakpadPFC_::DynamicImageRef> >::reserve(unsigned long) in ParseCrashReporting(dynamic_images.o) std::vector<google_breakpadPFC_::DynamicImageRef, std::allocator<google_breakpadPFC_::DynamicImageRef> >::_M_insert_aux(__gnu_cxx::__normal_iterator<google_breakpadPFC_::DynamicImageRef*, std::vector<google_breakpadPFC_::DynamicImageRef, std::allocator<google_breakpadPFC_::DynamicImageRef> > >, google_breakpadPFC_::DynamicImageRef const&) in ParseCrashReporting(dynamic_images.o) std::vector<unsigned char, std::allocator<unsigned char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned long, unsigned char const&) in ParseCrashReporting(dynamic_images.o) "std::string::_Rep::_S_empty_rep_storage", referenced from: BreakpadPFC_::HandleUncaughtException(NSException*) in ParseCrashReporting(Breakpad.o) BreakpadPFC_::Initialize(NSDictionary*) in ParseCrashReporting(Breakpad.o) google_breakpadPFC_::ExceptionHandler::ExceptionHandler(std::string const&, bool (*)(void*), bool (*)(char const*, char const*, void*, bool), void*, bool, char const*) in ParseCrashReporting(exception_handler.o) google_breakpadPFC_::ExceptionHandler::~ExceptionHandler() in ParseCrashReporting(exception_handler.o) google_breakpadPFC_::ExceptionHandler::UpdateNextID() in ParseCrashReporting(exception_handler.o) google_breakpadPFC_::MinidumpGenerator::GatherSystemInformation() in ParseCrashReporting(minidump_generator.o) google_breakpadPFC_::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in ParseCrashReporting(minidump_generator.o) ... "std::string::append(std::string const&)", referenced from: google_breakpadPFC_::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in ParseCrashReporting(minidump_generator.o) "std::string::append(char const*, unsigned long)", referenced from: google_breakpadPFC_::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in ParseCrashReporting(minidump_generator.o) "std::string::append(unsigned long, char)", referenced from: google_breakpadPFC_::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in ParseCrashReporting(minidump_generator.o) "std::string::_Rep::_M_destroy(std::allocator<char> const&)", referenced from: BreakpadPFC_::HandleUncaughtException(NSException*) in ParseCrashReporting(Breakpad.o) BreakpadPFC_::Initialize(NSDictionary*) in ParseCrashReporting(Breakpad.o) google_breakpadPFC_::ExceptionHandler::ExceptionHandler(std::string const&, bool (*)(void*), bool (*)(char const*, char const*, void*, bool), void*, bool, char const*) in ParseCrashReporting(exception_handler.o) google_breakpadPFC_::ExceptionHandler::~ExceptionHandler() in ParseCrashReporting(exception_handler.o) google_breakpadPFC_::ExceptionHandler::UpdateNextID() in ParseCrashReporting(exception_handler.o) google_breakpadPFC_::MinidumpGenerator::GatherSystemInformation() in ParseCrashReporting(minidump_generator.o) google_breakpadPFC_::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in ParseCrashReporting(minidump_generator.o) ... "std::__throw_out_of_range(char const*)", referenced from: google_breakpadPFC_::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in ParseCrashReporting(minidump_generator.o) "std::string::assign(char const*, unsigned long)", referenced from: MacStringUtilsPFC_::ConvertToString(__CFString const*) in ParseCrashReporting(string_utilities.o) "std::string::assign(std::string const&)", referenced from: google_breakpadPFC_::ExceptionHandler::ExceptionHandler(std::string const&, bool (*)(void*), bool (*)(char const*, char const*, void*, bool), void*, bool, char const*) in ParseCrashReporting(exception_handler.o) google_breakpadPFC_::ExceptionHandler::UpdateNextID() in ParseCrashReporting(exception_handler.o) google_breakpadPFC_::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in ParseCrashReporting(minidump_generator.o) MacStringUtilsPFC_::IntegerValueAtIndex(std::string&, unsigned int) in ParseCrashReporting(string_utilities.o) void google_breakpadPFC_::ReadImageInfo<google_breakpadPFC_::MachO64>(google_breakpadPFC_::DynamicImages&, unsigned long long) in ParseCrashReporting(dynamic_images.o) void google_breakpadPFC_::ReadImageInfo<google_breakpadPFC_::MachO32>(google_breakpadPFC_::DynamicImages&, unsigned long long) in ParseCrashReporting(dynamic_images.o) "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from: BreakpadPFC_::HandleUncaughtException(NSException*) in ParseCrashReporting(Breakpad.o) BreakpadPFC_::Initialize(NSDictionary*) in ParseCrashReporting(Breakpad.o) MacStringUtilsPFC_::IntegerValueAtIndex(std::string&, unsigned int) in ParseCrashReporting(string_utilities.o) google_breakpadPFC_::ReadTaskString(unsigned int, unsigned long long) in ParseCrashReporting(dynamic_images.o) "std::string::substr(unsigned long, unsigned long) const", referenced from: MacStringUtilsPFC_::IntegerValueAtIndex(std::string&, unsigned int) in ParseCrashReporting(string_utilities.o) "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)", referenced from: google_breakpadPFC_::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in ParseCrashReporting(minidump_generator.o) google_breakpadPFC_::MinidumpGenerator::WriteModuleStream(unsigned int, MDRawModule*) in ParseCrashReporting(minidump_generator.o) void google_breakpadPFC_::ReadImageInfo<google_breakpadPFC_::MachO64>(google_breakpadPFC_::DynamicImages&, unsigned long long) in ParseCrashReporting(dynamic_images.o) void google_breakpadPFC_::ReadImageInfo<google_breakpadPFC_::MachO32>(google_breakpadPFC_::DynamicImages&, unsigned long long) in ParseCrashReporting(dynamic_images.o) google_breakpadPFC_::DynamicImage::DynamicImage(unsigned char*, unsigned long, unsigned long long, std::string, unsigned long, unsigned int, int) in ParseCrashReporting(dynamic_images.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

The error was because somehow the "-ObjC" flag sets off a bunch of stuff...

I fixed this by:

  1. Linking the libstdc++.6.dylib, which removed all the errors but created a second set
  2. Removing the bolts framework, apparently there the facebook and bolt conflict since facebook already contains that framework

Everything works after that

Added libstdc++.6.dylib as follows, which resolved the issue:

将二进制文件与库链接

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM