Firebase SDK 与 Facebook SDK 冲突

Posted

技术标签:

【中文标题】Firebase SDK 与 Facebook SDK 冲突【英文标题】:Firebase SDK conflicts with Facebook SDK 【发布时间】:2015-03-03 23:43:20 【问题描述】:

我按照最新的教程设置 firebase SDK:

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

但是,我发现我遇到了一堆构建时错误。删除 Facebook SDK 后,一切恢复正常,我可以使用 Firebase SDK。但是,我的应用中需要 Facebook SDK。

谁能帮忙找出冲突的原因。

附:我完全按照教程进行操作,并且有一个没有 Facebook 的可运行的 firebase 应用程序

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)

【问题讨论】:

【参考方案1】:

错误是因为“-ObjC”标志以某种方式引发了一堆东西......

我通过以下方式解决了这个问题:

    链接 libstdc++.6.dylib,这消除了所有错误但创建了第二组 移除 bolts 框架,显然 facebook 和 bolt 存在冲突,因为 facebook 已经包含该框架

之后一切正常

【讨论】:

【参考方案2】:

添加libstdc++.6.dylib如下,解决了问题:

【讨论】:

以上是关于Firebase SDK 与 Facebook SDK 冲突的主要内容,如果未能解决你的问题,请参考以下文章

facebook SDK [Firebase Ref.,Swift] 中缺少 FBSessionStateOpen

添加 Facebook sdk 和 Google Firebase sdk 时的 Android Proguard 问题(重复)

如何将 firebase 的 firestore/admin sdk 与 next.js 一起使用

如何使用 Firebase 统一创建 Facebook 登录?

Firebase iOS SDK 崩溃与 FIRInstallations validateAppOptions:appName

Firebase Facebook 登录 - 检测用户登录状态并重定向