Git Product home page Git Product logo

Comments (14)

AnastasiaKubova avatar AnastasiaKubova commented on August 27, 2024

Hi! Thanks for getting in touch with us!
I try to reproduce your issue follow your steps, but unfortunately I didn't get the same behavior.
Could you please share a sample project with reproducing this issue?

from plcrashreporter.

krassx avatar krassx commented on August 27, 2024

Can't check the code at the moment, so the following is just a guess. If I am not missing anything, the line

if ((crashReporter?.hasPendingCrashReport()) != nil) {

may incorrectly be truthy when false is returned from hasPendingCrashReport (which is defined as BOOL). And, consequently, the code will call the handleCrashReport() method, when it should not.

from plcrashreporter.

hemaks123 avatar hemaks123 commented on August 27, 2024

CrashReporterSample.zip

from plcrashreporter.

hemaks123 avatar hemaks123 commented on August 27, 2024

Please check the sample code where I simulated a crash already but Loading data throws the error.

from plcrashreporter.

hemaks123 avatar hemaks123 commented on August 27, 2024

try crashReporter.loadPendingCrashReportDataAndReturnError() this returns "The file “live_report.plcrash” couldn’t be opened because there is no such file." error.

from plcrashreporter.

hemaks123 avatar hemaks123 commented on August 27, 2024

Could you please tell me, is there any dashboard where I could see the crash reports? How long it will take to return the pending reports, is there any particular duration? Because I just need to see the logs when crash happens. If you can share any documentation for this also would be great.

from plcrashreporter.

DmitriyKirakosyan avatar DmitriyKirakosyan commented on August 27, 2024

Hi @hemaks123 , thank you for the demo app. I've checked it and found a couple of issues in your code:

  • The check crashReporter.hasPendingCrashReport() is missing
    You should always check if hasPendingCrashReport returns true before calling loadPendingCrashReportDataAndReturnError. Otherwise you'll get the error no such file.
  • CrashReporter.Shared.crashReportActivate() is called twice (doesn't affect the functionality though)

Follow the steps to get the crash report data:

  • Launch the app (Important: The app should not be launched in Debug mode, otherwise XCode will catch and debug the error)
  • Click the button
  • Launch the app again, this time in Debug mode and observe that loadPendingCrashReportDataAndReturnError returns the crash report data.

Here is a demo application that you can use as an example of how to use the lib.

Please, let me know if it works for you.

Could you please tell me, is there any dashboard where I could see the crash reports? How long it will take to return the pending reports, is there any particular duration? Because I just need to see the logs when crash happens.

The PLCrashReporter library doesn't send data over the network, and doesn't provide dashboards or any other user interface for monitoring crashes. If you need a UI for tracking your crashes, you can use MS App Center or create your own tracker based on data from the PLCrashReporter.

from plcrashreporter.

hemaks123 avatar hemaks123 commented on August 27, 2024

Hi DmitriyKirakosyan ,

I tried with the latest framework in Xcode 12 and tried your approach as well, it is working now. I really appreciate all of your help on this solution.
Do the framework track the Swift errors or runtime errors, MACH_EXCEPTION and the errors thrown by SwiftUI?
I can see only 1.7.2 . How can I get the latest 1.8.0 version release ?
eg : var arr = [String]
arr[1] // will crash out of range

from plcrashreporter.

MatkovIvan avatar MatkovIvan commented on August 27, 2024

Do the framework track the Swift errors or runtime errors, MACH_EXCEPTION and the errors thrown by SwiftUI?

All not caught exceptions/errors falls to mach server or to just unix signal handler. PLCR should catch all of it.

I can see only 1.7.2 . How can I get the latest 1.8.0 version release ?

@hemaks123 1.8.0 is not release yet, it will be the next version. It's always available for building from sources if you want to test unreleased changes

from plcrashreporter.

MatkovIvan avatar MatkovIvan commented on August 27, 2024

1.8.0 has been released. Good timing :)

from plcrashreporter.

hemaks123 avatar hemaks123 commented on August 27, 2024

Good to hear that, I will try to integrate the latest release.

from plcrashreporter.

hemaks123 avatar hemaks123 commented on August 27, 2024

@DmitriyKirakosyan :
I tried with the latest framework, and simulated the scenario by creating crash on release mode and then tried to check in debug mode. It is giving the report on next day, I am not able to get the report on next launch. Is there any duration for getting the crash reports or any sample code or API documentation. I need to send the last crash report to server on each relaunch.
My implementation is given below ,

  1. Added the Crashreporter 1.8.0 framework
  2. Added the simulated a crash on release mode.
  3. Relaunched it in debug mode
  4. Still hasPendingCrashReports returns false(I had simulated a crash)

from plcrashreporter.

DmitriyKirakosyan avatar DmitriyKirakosyan commented on August 27, 2024

@hemaks123,

I've tested v1.8 with your project and it worked for me as expected. I've also tested on a new test app, adding the lib manually and downloading via cocoa pods, on an emulator and a real device. Everything worked as expected.

Could you please share more details about your test steps?
(Note that the crash logs are writing on the device's disk and the file is unique for each app. So you should initiate a crash and debug the crash report for the same app on the same device.)

Here's what I do:

  1. Opened your test project and updated the PLCrashReporter to v1.8
  2. Launched the app from Xcode with the debugger attached and stopped the debugging
  3. Launched the app on the device without debugging and clicked the button. The app crashed
  4. Launched the app from Xcode with the debugger attached. hasPendingCrashReports was true and I could load the crash report data using loadPendingCrashReportDataAndReturnError

Is there any duration for getting the crash reports or any sample code or API documentation.

Actually, you should not experience any delay in getting the crash report. It's writing to the file once the crash happens and thus it should be available on the next launch. If you don't get the crash report on the next app launch, let's figure out why it happens :) Please try my steps and let's see if it works for you.

The sample code can be found here: https://github.com/microsoft/plcrashreporter/blob/master/Other%20Sources/Crash%20Demo/main.m

from plcrashreporter.

vvechkanov avatar vvechkanov commented on August 27, 2024

Hello again!

We haven’t heard from you in a few days, hope everything is going well! We did not reproduce this issue, so I will close this ticket for now. Should you need further assistance or have any further questions, please feel free to reopen or/and reply.

Thanks for using App Center!

from plcrashreporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.