Comments (14)
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.
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.
from plcrashreporter.
Please check the sample code where I simulated a crash already but Loading data throws the error.
from plcrashreporter.
try crashReporter.loadPendingCrashReportDataAndReturnError() this returns "The file “live_report.plcrash” couldn’t be opened because there is no such file." error.
from plcrashreporter.
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.
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 ifhasPendingCrashReport
returnstrue
before callingloadPendingCrashReportDataAndReturnError
. Otherwise you'll get the errorno 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.
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.
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.
1.8.0 has been released. Good timing :)
from plcrashreporter.
Good to hear that, I will try to integrate the latest release.
from plcrashreporter.
@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 ,
- Added the Crashreporter 1.8.0 framework
- Added the simulated a crash on release mode.
- Relaunched it in debug mode
- Still hasPendingCrashReports returns false(I had simulated a crash)
from plcrashreporter.
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:
- Opened your test project and updated the PLCrashReporter to v1.8
- Launched the app from Xcode with the debugger attached and stopped the debugging
- Launched the app on the device without debugging and clicked the button. The app crashed
- Launched the app from Xcode with the debugger attached.
hasPendingCrashReports
wastrue
and I could load the crash report data usingloadPendingCrashReportDataAndReturnError
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.
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)
- crash report miss crashed thread and register HOT 3
- Can I integrate PLCrashReporter within a framework? HOT 1
- Xcode 14.3 beta support HOT 5
- Warnings when building client code with `CLANG_WARN_OBJC_INTERFACE_IVARS=YES` HOT 3
- AddressSanitizer: CHECK failed: sanitizer_posix.cpp:61 HOT 8
- Xcode 15 build error HOT 6
- Hangs and Unresponsive Behavior in App Crashes (Ditto SDK and Rust 1.65+ on Apple arm64 Devices) HOT 8
- App getting crashed on launch. HOT 5
- Unable to use PLCrashReporter in simulator when embedded in xcframework HOT 8
- Support for visionOS HOT 2
- Bump macOS and Xcode versions to latest available (macOS-13, Xcode 15.0) HOT 3
- Compilation error when use library with Bazel & SPM HOT 10
- Kotlin multi-platform exception handling issue HOT 7
- Apple Privacy Manifest HOT 13
- Discussion: AppCenter retirement and PLCrashReporter HOT 1
- Library is not able to load pending crash report and throwing an error Domain=PLCrashReporterErrorDomain Code=2 HOT 6
- Build issues on 1.11.2
- arm64e PAC stripping mask HOT 5
- Xcode 16 beta 2 build issue HOT 4
- When dealing with Kotlin Multiplatform (KMP) and encountering a hang instead of crash on iOS. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plcrashreporter.