Crashlytics is not sending Crash report from iPhone - ios

I've setup the Crashlytics in my one iOS application and installed the application on a real device. My Crashlytics Dashboard is displaying that, I've successfully added the app. However, it's not sending crash report. My internet speed is not so good. But I can check my emails from this device. Can anybody guess, where is the problem?

Xcode debugger does NOT allow Crashlytics to process crash reports. Yeah, that seem weird even to me when I read that first time but it is a fact (Source). That's is the reason we never see crash report When:
- running app in Simulator
- running app on iDevice by directly build and run from Xcode with debugger on.
To make sure a crash is reported during your testing (copied from Crashlytics support site):
1. Launch simulator
2. Press stop
3. Launch your app and force a crash
4. Relaunch the app from simulator
5. See the crash report in the web dashboard.
EDIT:
Added a reference; Crashlytics also provides a short article on a quick way to force a crash.

My be it's late but work 100%
Make some changes in project build settings like in below image
and follow these instructions.

The primary reason any crash reporter won't work on iOS is due to interference from different crash reporters. However, with Crashlytics specifically there could be something specific to them causing the crash report not getting reported.
Xcode debugger does NOT allow Any Crash Reporter to process crash reports. This is because XCode overrides any hooks into the crash handling call backs. This only happens when:
running app in Simulator (with debugger on)
running app on iDevice by directly build and run from Xcode with debugger on.
To make sure a crash is reported during your testing (http://support.crashlytics.com/knowledgebase/articles/92523-why-can-t-i-have-xcode-connected-):
Launch simulator
Press stop
Launch your app and force a crash
Relaunch the app from simulator
See the crash report in the web dashboard.
While a super old video it's still relevant, here's a video of the steps above (example from Crittercism): https://www.youtube.com/watch?v=sU6Su3PBFH4

For me, the problem was that the device was connected to my Mac :)
From this source:
Also, if you have your device connected to your Mac, XCode's debugger
will step in as well. So just disconnect the device before testing :)

I found solution using following steps
1. Go to Edit Scheme
2. Run -> Info
3. Change Build Configuration to release.
Now run the app crash it. You will receive mail.

We recently ran into this issue and I found that somewhere along the way the build script was removed. Adding it back in with the following fixed the issue for us:
./Crashlytics.framework/run <your_api_key> <build_secret>
Note : When using Cocoapods you will want to us the following instead of the above (source):
./Pods/CrashlyticsFramework/Crashlytics.framework/run
Adding a build script:
To add a Run Script Build Phase in Xcode 6, select your application target in your project, then select "Build Phases".
Click the small "plus" icon and select "New Run Script Build Phase".
You should now see a Run Script section in the middle of your Build Phase options, as shown above.
Inside the body of the Run Script Build Phase, paste in the script.`
The above quote comes from Crashlytics's visual tutorial, referenced in this post.
Note: I originally posted this answer verbatim for Crashlytics error code: 202 when Submitting files.

From the RayWenderlich site:
You won’t get any crash reports if Xcode intercepts the crash event!
To make all the examples below work, you have to build and run the
application, then click the stop button on Xcode. This way you will
have the latest version installed on the the device. Once that is
done, you can launch the app on the device itself, and then crash it
all you want! All the crashes on your iOS device will be caught and
sent to the server component of the service that you have integrated
into the app. Crash reports are usually sent to the server the next
time you start the app, so the steps to follow to generate a crash
report on the server are as follows: Build and run on Xcode. Press the
stop button. Run the app on your iOS device. Make the app crash. Run
the app again.

Crashlytics works for me until now.
I don't know why but now it doesn't work.
You should turn debug-mode on by
[Crashlytics sharedInstance].debugMode = YES;
My problem is here Crashlytics error code: 202 when Submitting files :(

Make sure you are not forcing the crash too early.
Set [Crashlytics sharedInstance].debugMode to YES;
Watch for
Crashlytics] Settings loaded
on the Xcode console logs.
Then force the crash and restart the app, and the crash will be reported now.

I ran into a similar problem when trying the test crash code.
Crashlytics.sharedInstance().crash()
I was running my app from a device, without Xcode, and the crash wouldn't show up on Crashlytics Dashboard. What worked for me was the following tip from Crashlytics website:
Make sure to launch the app after crashing it, so that the crash can
be uploaded
I commented out the above crash() call, and re-ran the app. Then the crash showed up in the Dashboard.

This is for xcode 9, from crashlytics 3.4.0
After doing this, be patient and wait for a few minutes.

Have you tried running [[Crashlytics sharedInstance] crash] on a device and seeing if that gets reported? There are a few reasons why Crashlytics might not work including other crash reporters etc.

If you don't upload the dSYM file, Crashlytics will not show your crash even though the report successfully uploaded.
You could run into this problem, if you have set up your build-script to only run on your CI server. Then if you have copied your app to your phone via xcode and you run it without being attached to the debugger, the report will be uploaded but ignored, because of the missing dSYM file.

Sometimes, it takes some time for the logs to show up. I am able to find them after 15-20 mins

One of the issue I feel that in the Run Script Phase, it should be a separate Run Script Phase for CrashLytics. When had the run script
./Fabric.framework/run
With some of my other script, everything was ok, CrashLytics log show report submitted, but nothing was in the web interface.
When I add another Run script phase only with Fabric run, it appears like a magic :)
My first try was with cocoapods, but that did not work.
When I manually add all the framework and a separate run script phase that worked.

This worked for me,
If you're testing on iDevice, just unplug iDevice with your Xcode and run your app.
Now, If crashed it will be updated on dashboard.

I solved by deselecting "Run Script only when installing" option in Run script (one for Fabric(crashlytics))

Related

Crashlytics report can be generated only after re run the app

I just implemented Fabric Crashlytics tool to my Xcode project via Swift Package Dependencies.
All works good if I enable Google Analytic on a step when I create an app, without this step I did not received crash reports, so I switched to the app with Google Analytic enabled.
I've tested crash button from the link:
One comment that I don't like from there
"After your app crashes, run it again from Xcode so that your app can
send the crash report to Firebase."
Does it mean that user has to reopen app to send crash report? For example if a user download an app from the App Store and then somehow the app is crashed. Does mean that reopening app required for sending that crash? And if the user will not open the app it means I lost this crash report? I understand that on live store there is no option to re run it form Xcode, but reopening seems a require step.
I suppose the crash report should work different a bit by sending issue details right after a crash, I may be wrong here.
Also when I set everything via Swift Package Dependencies looks like I don't have an option to upload dSYM via this option
/path/to/pods/directory/FirebaseCrashlytics/upload-symbols -gsp /path/to/GoogleService-Info.plist -p ios /path/to/dSYMs
Does this mean I need to pull Fabric and Crashlytics from CocoaPods?
I've switched off bitcode at the moment and looks like all is works automatically but not sure it is good idea for long perspective.
Yes, crashes will be uploaded when restarting the app after it crashes. As far as I know, this is because the SDK may not have enough time to actually send the report when the crash happens.
If you are using Swift Package Manager, you still have that option.
This is the command:
"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"
If the app has bitcode enabled, then you'll need to download the dSYMs from the App Store and upload them manually.
Lastly, Fabric is now deprecated so don't download it. You don't need to use Cocoapods if you are already integrated Crashlytics with SPM.

Firebase Crashlytics won't activate

I have run my app on a device and in simulator with no success of updating the Firebase Crashlytics system.
I am not getting any errors, and I know that it's installed because it says the version number (4.5.0) in console.
Also Firebase Analytics is working.
I have followed the install guide to a T and also tried to force crash it by creating a SwiftUI button and using
fatalError()
Which seems to not fully crash the app, but more freeze the app.
I am wondering how I can trace this issue with SwiftUI and Firebase.
In addition of doing what the accepted answer recommends and I believe this is something new from Xcode 12.+. You need to uncheck the two checkboxes below the script window (at least once - you may tick them back up once registered with firebase). This (as stated) forces the script to run and therefore to communicate with firebase... the checkboxes unticked
As outlined here, if you're going to use the Xcode Simulator, you must detach the Xcode debugger at runtime by launching the app directly from the Simulator and not Xcode. Xcode automatically attaches its debugger if you launch from Xcode to a Simulator, blocking Crashlytics from being able to see exceptions/crashes.

FirebaseCrashlytics did not report crash to my firebase console dashboard

I was updating Fabric to new Firebase, my firebase showed old fabric crash report and no Firebase report. Now my firebaseCrashlytics version is 4.3.1. I had added GoogleService-Info.plist, script phase "${PODS_ROOT}/FirebaseCrashlytics/run" and phase's input files:${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME},
$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH).
When I run my app, xcode console printed "[Firebase/Crashlytics] Version 4.3.1", no other log. I did not know what problem happened.
Few things you need to verify .
1- Is your crashlytics connected to your app.
Even though you initially connect your app in the setup phase to get the googleInfoPlist , you have to run it again and connect again .Select the crashlyitcs tab and you will get to click "Add SDK" which i think at this point you have completed .
After that run your app again and navigate through the app and at some point it will say that it is connected.
Another thing is you can force a crash but it wont appear in the crashlogs directly.
First you run it on the device and the stop running. Re-open the App and recreate the crash again. The Crash will not appear as long as the debugger is connected to your Emulator/Device

Unity Debug log not showing in iOS build

guys I've been struggling with the following issue for couple of days and hope that somebody could help me.
I want to get my app logs from running iOS device. If I run the app from the Xcode, then I see my logs in debug view as expected.
However, when I download a build from my testflight app I'm not able to access the logs anymore. Google suggest that I use Xcode -> Devices -> Log of a device, but there are only system events log and no messages from my app.
Running Unity 5.5.2.p2, Xcode 8.2.1. with ios 10 and 9 tested.
Would appreciate any help, because this issue is really exhausting.
After a bit more searching I found out that it's not possible, unfortunately. But I've managed to make a solution, hope it helps somebody.
Apple's native NSLog prints all the logs to a console app even after the app was downloaded from TestFlight.
I made a simple iOS plugin wich catches all the debug logs and forwards them to a NSLog. Make sure you call
LogManager.Init()
somewhere on app start.
Hope this will help somebody. The plugin is here
https://drive.google.com/open?id=0B7Yn93mXrM82ODZlbDVTNmo0QlU
Archiving for TestFlight means Build Configuration is release.
SO you won't be able to see the dubug log on testflight build.
Follow this link to make a debuggable TestFlight build.
Or simply add DEBUG=1 on Release section under Preprocessor Macros

how to see NSLog in my SDK project under iOS 10

I have a SDK project which will compile and build a framework. Inside this project, I have my person NSLog shown there. I have another framework test app to using this framework to do my task. After upgrading to iOS 10 and Xcode 8, I notice all the NSLog are gone. I cannot find it anywhere.
I search and find this answer: iOS 10 doesn't print NSLogs, I gave a try for both my SDK project and my framework test app, adding OS_ACTIVITY_MODE "disabled", however, it is still not showing NSLog.
Update: I still have one device which is iOS 9, I gave a try on that one, NSLogs are still shown in device console. Using Mac's console app I can also see my own logs.
This is a MFI project so I cannot directly debug this project, because the lighting cable is always connected with my hardware. I can only use log to see what happened.
OS_ACTIVITY_MODE set as disable remove OS activity state which is printed during the when project is runs. OS_ACTIVITY_MODE is only printed only in the x-Code 8.0 but when you upgrade your x-codefrom 8.0 to 8.1 you can found that it does not print any console for OS. But in overall procedure I have found that NSLog is working properly.
For your confirmation i just update my old project and run it into x-code 8.1. Output as below images
Environment variable
Nslog Code
console print
Suggestion
I have checked your problem in multiple style with multiple project but I didn't found any problem. So I just suggest you
To update your x-code
or
Re-install x-code after removing previous x-code completely.
Because If it is x-code bug them i also have to face the same in my every experiment.
If you still have any query you can ask.
Apple did some changes the way NSLog works and I probably you might not be able to get them.
My recommendation is that you change your NSLog to something that prints to the output console without using NSLog.
I'm the co-founder of a product called Bugfender that might help you, what we do is that we provide a BFLog function that will print the logs to the console and also upload them to our servers, so you can always check the logs without any need to connect the device to your computer.
The only problem our product has is that it's not in real time, but usually there's a delay of a few seconds. Some of our customers are using it to debug the app instead of using the XCode console.
If you set this,you can not see any log in your device ,but you can see that in simulator.

Resources