Firebase Crashlytics and Sentry do not work together? (iOS) - ios

I have to work with 2 different SDKs which should report the Crashs. Once is Firebase Crashlytics and the other is Sentry. The second one I need in the company for different tools. With Firebase I have a better overview in general.
My problem now is, I see only the crashs in Firebase, but not in Sentry. If I create by my own a crash, then it appears in both. I don't understand what is happen.
What I know is that when an app is crashing the OS creates the report and the SDK in the app is checking this with the next start of the app.
For me it looks like that Firebase catch the crash reports and Sentry didn't get it. But then why I can see my self created crashs in both?
Do you have some experience with both frameworks in one project?

This came up before, including in the Sentry forum.
It's not a supported use case. Each error tracking SDK will attach to the signal handler to stack unwind during a crash and only one of them will succeed.
EDIT: We did some tests and it seems to work. At least on the device we tested, connected to WiFi, etc. That said, we heard reports that it didn't work in other cases.
So as I wrote on the comment below, it's undefined behavior and not recommended to be relied upon.

Related

Can't see any app data or crash reports on NewRelic platform

I am a new iOS developer, and I was attempting to implement NewRelic as my crash reporting platform for a test application before I use it with a different application, but I cannot seem to receive any data on NewRelic. I went through the Cocoapods installation here: https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-ios/installation/cocoapods-installation/ with my own app on Swift. After that didn't work, I used a coworkers test app, who had the crash reporting working, and it still wouldn't work for me.
One difference that we have noticed is that I receive this notification from Apple when crashing my test app on XCode simulator...
We figure the data isn't being sent because something is getting in the way of the process, but we can't figure out why. I have tried disabling debugging on XCode. I have tried almost everything that NewRelic suggests on their website and through their technical support. Has this happened to anyone else before?

Percentage of crash-free sessions in Crashlytics is wrong

I am an iOS developer, and recently I try to find a tool to track crashes in our project.
After I integrated Crashlytics in my demo, I forced the demo to
crash for some times and check if the data in Crashlytics is correct.
But then I am confused by the data on the dashboard because the
percentage of 'CRASH-FREE SESSIONS' is always '<1%', while the total
number of crashes is 65.
Even I launch my demo and then kill it without crash it for several
time, the '<1%' doesn't change.
Is it a bug of Crashlytics?
I have sent 3 email to support#fabric.io, but did not get any reply. I don't know what is going on here.
That depends on your users. I had the same problem because I was testing it within my simulator and my iOS device, fabric is a service made by google. It's impossible to find a bug like that-- rest assured. Submit your app. Let your users use it, the actual result will come in a week
Hope this helps

Generating crash reports on Cocoa Touch apps

That probably sounds a lot worse than it is, but here's my question.
I am dealing with a crash on an actual device, that one of my tester's is using. At the moment, there is no way to discover what is causing the crash. I can not reproduce it on the simulator. However, on the simulator when something crashes I get log info about it in the output window. But I don't want to keep testing with the device connected.
Is it possible to log crash exceptions, etc into a file when things crash. I know certain apps can do it, but I am not sure how?
Any info would be appreciated.
There are generally two ways to do that:
Someone get the tester to send you the crash reports, that iOS created on the device. This is usually too tricky for end users, so the next suggestion works better. That's also why I am not describing how to do that :) But you'll find plenty of documentations on that process.
Integrate a crash reporting library, that catches the crashes and allows you to receive them in various ways. You should not implement your own global crash exception handler, things are just too complex to do it right (even though other people will tell you otherwise). Also crashes caused by exceptions are only one type of crashes.
There are multiple open source libraries out there, the safest one to use is anything based on PLCrashReporter. Most others use private or undocumented iOS APIs, or are not async-safe, which basically means those can destroy app data or make the crash even worse. See this blog post about the topic: http://landonf.bikemonkey.org/code/crashreporting/Reliable_Crash_Reporting_1.1.20130119.html
The following linked answer shows some of the available options on how to add logging to your app and also various options on how to receive crash reports for test version and also once the app is released: Including custom data into iOS crash dumps
If you're open to using a third party service, I use https://www.crashlytics.com. Makes debugging crashes from user devices painless.

iOS app cannot be opened after update

We have an app live in the app store for almost an year, and we've been receiving several bad reviews from customer which cannot open the app after updating it.
Users have reported they are unable to launch the application following deleting and subsequently reinstalling the application.
One user did indicate they could launch the application only following a factory reset of their iPhone.
We believed the issue was related to the Keychain, since this seems to be persistent in the system. For this reason we updated the third party library we are using to access the keychain to https://github.com/soffes/sskeychain. This change was made in version 1.4.1.
After releasing 1.4.1, a couple of users indicated they were finally able to open the app. Unfortunately, as we are unable to debug the issue we were unable to determine what possible issue might have been resolved. Furthermore, we saw other users still having the same issue upgrading to 1.4.1 and also to 1.4.2.
We are also considering the issue may be with one of our dependent libraries:
Flurry analytics
Facebook iOS SDK
PayPal MPL
Hockeyapp ios lib
ASIHTTPRequest
we do not use CoreData
We are unable to debug this with the standard iOS tools and we can't even expect hockey app to provide us a crash report since the app is closed before sending it.
This behaviour we do not understand, and we clearly have no control on the app while is being updated from the app store. Is there anything that persists for an application on its deletion? If not, are you aware of anything that might prevent the opening of the reinstalled app?
EDIT:
we are configuring hockeyapp lib in applicationDidFinishLaunching: app delegate's method in this way:
[[BITHockeyManager sharedHockeyManager] configureWithIdentifier:QUINCY_APP_IDENTIFIER delegate:self];
[[BITHockeyManager sharedHockeyManager] setDisableUpdateManager:YES];
[[[BITHockeyManager sharedHockeyManager] crashManager] setCrashManagerStatus:BITCrashManagerStatusAutoSend];
[[BITHockeyManager sharedHockeyManager] startManager];
#ifdef DEBUG
[[BITHockeyManager sharedHockeyManager] setDebugLogEnabled:YES];
#endif
the app identifier is configured in the build settings and distinct per each configuration.
In general there can be multiple issues happening on startup:
A required library is not linked correctly: But this can NOT be the issue, since then all app starts would crash!
Startup is taking taking too long and the app is killed by the watchdog.
This could be your problem if you are doing e.g. migration of a lot of data on the main thread right in the applicationDidFinishLaunching: runloop and hence the app is not responsive for user input and hence will be killed by the watchdog after about 20 seconds.
Make sure to do migration without blocking the main thread!
You are experiencing a crash (not a kill!) on startup. Since the app crashes before the HockeyApp SDK can send the crash, you won't be able to get those crash reports.
The HockeyApp iOS SDK provides a mechanism to handle these, follow the instructions given in the following page: http://support.hockeyapp.net/kb/how-tos-faq/how-to-handle-crashes-during-startup-on-ios
So either 2. or 3. are your issue. If you have a chance to directly contact a user who is affected, you could ask for the iOS generated crash report. Otherwise check the recommendations I gave.
We had this problem once. The app worked fine as an Ad Hoc build. Apple tested and approved it; however, end users would crash immediately upon opening.
For us, it turned out to be that we were not properly passing our HockeyApp production API key in correctly.
Once we got that fixed users were good to go. For Example:
[[BITHockeyManager sharedHockeyManager] configureWithBetaIdentifier:#"betaKeyHere"
liveIdentifier:#"liveKeyHere"
delegate:self];
I can't believe it, but I finally found the reason why the app crashes.
[[NSLocale currentLocale] objectForKey: NSLocaleCountryCode] sometimes returns nil.
I made the assumption this was always valid, but apparently I was wrong.
I found this other question here NSLocaleCountryCode returns nil. it should be the right place for a follow up on this issue.
Thanks to #kerni suggestion I was able to made hockeyapp send reports of application launching crashes, but unfortunately this wasn't enough to understand what happened: the stack trace of the report was not clear.
After a couple of tries, I discovered another bad bad thing related to flurry. This was capturing the system exceptions and avoid hockeyapp to correctly handle the crash and produce a reasonable report.
This discussion was very helpful for me to identify and correct my flurry integration code: http://support.hockeyapp.net/discussions/questions/1359-more-information-for-crashes-with-reason-no-reason-found
After this change, I was finally able to see a decent crash report on hockeyapp and identify my issue: the current locale.

Programmatically getting Crash Reports inside an iOS app

I want to access the crash reports of my app inside my app and i need to send the crash reports to a server. I searched in google and I couldn't find any API that helps my purpose but I found there are open source projects like QuincyKit, plcrashreporter for getting the crash reports of the application. If I use these APIs will apple reject my app ?
Thanks in Advance
There is no API from Apple to do that. So the only chance is to use a 3rd party framework which catches the crash when it happens and provides options to further process it afterwords.
There are multiple solutions available, one is QuincyKit. The second part of the answer of Including custom data into iOS crash dumps shows all known solutions and services that you can use.
Note: I am the developer of QuincyKit and also part of the HockeyApp team.
About QuincyKit:
I've used only Flurry, which has crash collection, and there seems to be no problem in using these libraries in your project for the app store.

Resources