Konfiguracja google-breakpad z projektem iOS

0

Jak dodać google-breakpad do projektu iOS w Xcode? Niestety nie znalazłem żadnej dokumentacji w internecie, a moja znajomość maca, xcode i iOS jest praktycznie zerowa.

0

Polecam PLCrashReporter, jest bardzo łatwy w użyciu.

BTW: pamiętaj, że takie rozwiązanie jest dobre jeśli masz certyfikat pozwalający na dystrybucję oprogramowania poza AppStore. Jeśli dystrybuujesz aplikację przez AppStore to jakikolwiek crash reporter może nie przejść przez review Apple (masz używać tego co dostarcza system).

0

No dobra, ale to jednak musi być google-breakpad

0

Dodałem bilblioteki libstdc++.dylib i libBreakpad.a, ale wyrzuca mi błędy linkera

Ld build/TestBreakpad.build/Debug-iphonesimulator/TestBreakpad.build/Objects-normal/i386/TestBreakpad normal i386
    cd /Users/user/TestBreakpad
    export IPHONEOS_DEPLOYMENT_TARGET=7.1
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -L/Users/user/TestBreakpad/build/Debug-iphonesimulator -L/Users/user/google-breakpad-read-only/src/client/ios/build/Debug-iphonesimulator -F/Users/user/TestBreakpad/build/Debug-iphonesimulator -filelist /Users/user/TestBreakpad/build/TestBreakpad.build/Debug-iphonesimulator/TestBreakpad.build/Objects-normal/i386/TestBreakpad.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -lstdc++ -lBreakpad -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/user/TestBreakpad/build/TestBreakpad.build/Debug-iphonesimulator/TestBreakpad.build/Objects-normal/i386/TestBreakpad_dependency_info.dat -o /Users/user/TestBreakpad/build/TestBreakpad.build/Debug-iphonesimulator/TestBreakpad.build/Objects-normal/i386/TestBreakpad

Undefined symbols for architecture i386:
  "std::string::find_first_of(std::string const&, unsigned long) const", referenced from:
      MacStringUtils::IntegerValueAtIndex(std::string&, unsigned int) in libBreakpad.a(string_utilities.o)
  "std::string::find_first_not_of(std::string const&, unsigned long) const", referenced from:
      MacStringUtils::IntegerValueAtIndex(std::string&, unsigned int) in libBreakpad.a(string_utilities.o)
  "std::string::at(unsigned long) const", referenced from:
      google_breakpad::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in libBreakpad.a(minidump_generator.o)
  "std::string::size() const", referenced from:
      google_breakpad::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in libBreakpad.a(minidump_generator.o)
      MacStringUtils::IntegerValueAtIndex(std::string&, unsigned int) in libBreakpad.a(string_utilities.o)
  "std::string::c_str() const", referenced from:
      Breakpad::HandleUncaughtException(NSException*) in libBreakpad.a(Breakpad.o)
      Breakpad::GenerateReport(NSDictionary*) in libBreakpad.a(Breakpad.o)
      google_breakpad::ExceptionHandler::UpdateNextID() in libBreakpad.a(exception_handler.o)
      google_breakpad::ExceptionHandler::WriteMinidumpForChild(unsigned int, unsigned int, std::string const&, bool (*)(char const*, char const*, void*, bool), void*) in libBreakpad.a(exception_handler.o)
      google_breakpad::ExceptionHandler::set_dump_path(std::string const&) in libBreakpad.a(exception_handler.o)
      google_breakpad::MinidumpGenerator::GatherSystemInformation() in libBreakpad.a(minidump_generator.o)
      google_breakpad::MinidumpGenerator::WriteModuleStream(unsigned int, MDRawModule*) in libBreakpad.a(minidump_generator.o)
      ...
  "std::string::empty() const", referenced from:
      google_breakpad::ExceptionHandler::WriteMinidumpWithException(int, int, int, __darwin_ucontext*, unsigned int, bool, bool) in libBreakpad.a(exception_handler.o)
      google_breakpad::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in libBreakpad.a(minidump_generator.o)
  "std::string::substr(unsigned long, unsigned long) const", referenced from:
      MacStringUtils::IntegerValueAtIndex(std::string&, unsigned int) in libBreakpad.a(string_utilities.o)
  "std::allocator<char>::allocator()", referenced from:
      Breakpad::HandleUncaughtException(NSException*) in libBreakpad.a(Breakpad.o)
      Breakpad::Initialize(NSDictionary*) in libBreakpad.a(Breakpad.o)
      Breakpad::GenerateReport(NSDictionary*) in libBreakpad.a(Breakpad.o)
      MacStringUtils::IntegerValueAtIndex(std::string&, unsigned int) in libBreakpad.a(string_utilities.o)
      google_breakpad::ReadTaskString(unsigned int, unsigned long long) in libBreakpad.a(dynamic_images.o)
      google_breakpad::UTF16ToUTF8(std::vector<unsigned short, std::allocator<unsigned short> > const&, bool) in libBreakpad.a(string_conversion.o)
  "std::allocator<char>::~allocator()", referenced from:
      Breakpad::HandleUncaughtException(NSException*) in libBreakpad.a(Breakpad.o)
      Breakpad::Initialize(NSDictionary*) in libBreakpad.a(Breakpad.o)
      Breakpad::GenerateReport(NSDictionary*) in libBreakpad.a(Breakpad.o)
      MacStringUtils::IntegerValueAtIndex(std::string&, unsigned int) in libBreakpad.a(string_utilities.o)
      google_breakpad::ReadTaskString(unsigned int, unsigned long long) in libBreakpad.a(dynamic_images.o)
      google_breakpad::UTF16ToUTF8(std::vector<unsigned short, std::allocator<unsigned short> > const&, bool) in libBreakpad.a(string_conversion.o)
  "std::string::append(char const*)", referenced from:
      google_breakpad::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in libBreakpad.a(minidump_generator.o)
  "std::string::append(std::string const&)", referenced from:
      google_breakpad::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in libBreakpad.a(minidump_generator.o)
  "std::string::append(unsigned long, char)", referenced from:
      google_breakpad::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in libBreakpad.a(minidump_generator.o)
  "std::string::assign(char const*)", referenced from:
      MacStringUtils::ConvertToString(__CFString const*) in libBreakpad.a(string_utilities.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:
      Breakpad::HandleUncaughtException(NSException*) in libBreakpad.a(Breakpad.o)
      Breakpad::Initialize(NSDictionary*) in libBreakpad.a(Breakpad.o)
      Breakpad::GenerateReport(NSDictionary*) in libBreakpad.a(Breakpad.o)
      MacStringUtils::IntegerValueAtIndex(std::string&, unsigned int) in libBreakpad.a(string_utilities.o)
      google_breakpad::ReadTaskString(unsigned int, unsigned long long) in libBreakpad.a(dynamic_images.o)
      google_breakpad::UTF16ToUTF8(std::vector<unsigned short, std::allocator<unsigned short> > const&, bool) in libBreakpad.a(string_conversion.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)", referenced from:
      google_breakpad::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in libBreakpad.a(minidump_generator.o)
      google_breakpad::DynamicImage::GetFilePath() in libBreakpad.a(minidump_generator.o)
      void google_breakpad::ReadImageInfo<google_breakpad::MachO64>(google_breakpad::DynamicImages&, unsigned long long) in libBreakpad.a(dynamic_images.o)
      void google_breakpad::ReadImageInfo<google_breakpad::MachO32>(google_breakpad::DynamicImages&, unsigned long long) in libBreakpad.a(dynamic_images.o)
      google_breakpad::DynamicImage::DynamicImage(unsigned char*, unsigned long, unsigned long long, std::string, unsigned long, unsigned int, int) in libBreakpad.a(dynamic_images.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()", referenced from:
      Breakpad::HandleUncaughtException(NSException*) in libBreakpad.a(Breakpad.o)
      Breakpad::GenerateReport(NSDictionary*) in libBreakpad.a(Breakpad.o)
      google_breakpad::ExceptionHandler::ExceptionHandler(std::string const&, bool (*)(void*), bool (*)(char const*, char const*, void*, bool), void*, bool, char const*) in libBreakpad.a(exception_handler.o)
      google_breakpad::ExceptionHandler::ExceptionHandler(bool (*)(void*, int, int, int, unsigned int), void*, bool) in libBreakpad.a(exception_handler.o)
      google_breakpad::ExceptionHandler::WriteMinidumpForChild(unsigned int, unsigned int, std::string const&, bool (*)(char const*, char const*, void*, bool), void*) in libBreakpad.a(exception_handler.o)
      google_breakpad::ExceptionHandler::WriteMinidumpWithException(int, int, int, __darwin_ucontext*, unsigned int, bool, bool) in libBreakpad.a(exception_handler.o)
      MacStringUtils::ConvertToString(__CFString const*) in libBreakpad.a(string_utilities.o)
      ...
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()", referenced from:
      Breakpad::HandleUncaughtException(NSException*) in libBreakpad.a(Breakpad.o)
      Breakpad::Initialize(NSDictionary*) in libBreakpad.a(Breakpad.o)
      Breakpad::GenerateReport(NSDictionary*) in libBreakpad.a(Breakpad.o)
      google_breakpad::ExceptionHandler::ExceptionHandler(std::string const&, bool (*)(void*), bool (*)(char const*, char const*, void*, bool), void*, bool, char const*) in libBreakpad.a(exception_handler.o)
      google_breakpad::ExceptionHandler::ExceptionHandler(bool (*)(void*, int, int, int, unsigned int), void*, bool) in libBreakpad.a(exception_handler.o)
      google_breakpad::ExceptionHandler::~ExceptionHandler() in libBreakpad.a(exception_handler.o)
      google_breakpad::ExceptionHandler::UpdateNextID() in libBreakpad.a(exception_handler.o)
      ...
  "std::string::operator=(std::string const&)", referenced from:
      google_breakpad::ExceptionHandler::UpdateNextID() in libBreakpad.a(exception_handler.o)
      google_breakpad::ExceptionHandler::set_dump_path(std::string const&) in libBreakpad.a(exception_handler.o)
      google_breakpad::MinidumpGenerator::UniqueNameInDirectory(std::string const&, std::string*) in libBreakpad.a(minidump_generator.o)
      MacStringUtils::IntegerValueAtIndex(std::string&, unsigned int) in libBreakpad.a(string_utilities.o)
      void google_breakpad::ReadImageInfo<google_breakpad::MachO64>(google_breakpad::DynamicImages&, unsigned long long) in libBreakpad.a(dynamic_images.o)
      void google_breakpad::ReadImageInfo<google_breakpad::MachO32>(google_breakpad::DynamicImages&, unsigned long long) in libBreakpad.a(dynamic_images.o)
  "std::__throw_length_error(char const*)", referenced from:
      std::vector<MDMemoryDescriptor, google_breakpad::PageStdAllocator<MDMemoryDescriptor> >::_M_insert_aux(__gnu_cxx::__normal_iterator<MDMemoryDescriptor*, std::vector<MDMemoryDescriptor, google_breakpad::PageStdAllocator<MDMemoryDescriptor> > >, MDMemoryDescriptor const&) in libBreakpad.a(minidump_generator.o)
      std::vector<MDMemoryDescriptor, google_breakpad::PageStdAllocator<MDMemoryDescriptor> >::reserve(unsigned long) in libBreakpad.a(minidump_generator.o)
      std::vector<google_breakpad::DynamicImageRef, std::allocator<google_breakpad::DynamicImageRef> >::reserve(unsigned long) in libBreakpad.a(dynamic_images.o)
      std::vector<google_breakpad::DynamicImageRef, std::allocator<google_breakpad::DynamicImageRef> >::_M_insert_aux(__gnu_cxx::__normal_iterator<google_breakpad::DynamicImageRef*, std::vector<google_breakpad::DynamicImageRef, std::allocator<google_breakpad::DynamicImageRef> > >, google_breakpad::DynamicImageRef const&) in libBreakpad.a(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 libBreakpad.a(dynamic_images.o)
      std::vector<unsigned short, std::allocator<unsigned short> >::_M_fill_insert(__gnu_cxx::__normal_iterator<unsigned short*, std::vector<unsigned short, std::allocator<unsigned short> > >, unsigned long, unsigned short const&) in libBreakpad.a(string_conversion.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
0

Problem w tym, że bibliotekę masz dla architektury ARM, a próbujesz zbudować (uruchomić) dla emulatora, który ma architekturę i386!
Masz cztery wyjścia:

  • dostarczyć też bibliotekę dla i386
  • budować tak by projekt ni używał crash reportera na emulatorze (bo po co? tylko ty uzywasz emulatora)
  • dołączyć bibliotekę w postaci kodu źródłowego (jako podprojekt) - to jest najprostsze i najwygodniejsze.
  • nie używać emulatora
0
MarekR22 napisał(a):

dołączyć bibliotekę w postaci kodu źródłowego (jako podprojekt) - to jest najprostsze i najwygodniejsze.

Mówisz o wrzuceniu plików zródłowych czy dołączeniu pliku .xcodeproject

1 użytkowników online, w tym zalogowanych: 0, gości: 1