I was testing the non-fatal error functionality of Crashlytics and can't seem to get the recorded errors to appear in Crashlytics.
I did initialize Crashlytics in AppDelegate like this:
Fabric.with([Crashlytics.self])
And I test send error like this (the test code is in viewDidLoad method):
let error = NSError(domain: "myDomain", code: 1000, userInfo: nil)
Crashlytics.sharedInstance().recordError(error)
But nothing shows up in the analytics. I tried to:
Restart application
Disconnect from debugger and run the application several times
Add regular crash using Crashlytics.sharedInstance().crash(). In that case only the fatal crash is reported
I waited 4 days for the data to show up
Versions:
Crashlytics (3.8.5)
Fabric (1.6.12)
Thanks
I found what was the problem:
The application code was embedded in a framework. My tip is that the non-fatal logs were saved in the framework's bundle not the main bundle. On the next start the main bundle was searched for logs but none was found, thus nothing was sent.
My solution was remove the app from framework as it was no longer needed in the project. I am not sure how this would be solved if you would need to keep the code in the framework.
Run the script which uploads DSYMS to Firebase. Typically this script is not executed in debug mode - check the Build Phases tab. If you use such configuration just try in AdHoc build.
Please check if you uploaded DSYM file with your build.
I've just integrated Crashlytics with iOS and it's quite easy integration steps. I started session of crashlytics in didFinishLaunchingWithOptions with code [Fabric with:#[[Crashlytics class]]]; and its start tracking.
At some point in App I want to stop tracking of Crashlytics so how Can I do this? Is there any code for this? There is a way to stop tracking from online Dashboard in Crashlytics but I want to do from Code.
Looking for suggestions and help.
Thanks.
Xcode debugger does NOT allow Crashlytics to process crash reports.
if you have your device connected to your Mac, XCode's debugger will step in as well. So just disconnect the device before testing.
To make sure a crash is reported during your simulator testing:
Launch simulator
Press stop
Launch your app and force a crash
Relaunch the app from simulator
See the crash report in the web dashboard
Reference
Mike from Fabric here. I believe you're looking to kill an active Fabric session once it's been started with the same launch/session of the app.
In that case, there is not a way to kill the SDK session. I'd recommend wrapping the Fabric init in a conditional call or boolean check to see if Fabric should be initialized or not.
I have setup firebase in both the console and in the app. Everything configures correctly, and events appear to be logging in the app.
Output to console:
<FIRAnalytics/DEBUG> Logging event: origin, name, params: app,
log_something, {
"_o" = app;
"full_text" = khbsdpibdsjl;
name = lwkjbgskljsavdkjl;
}
I have the debug flag enabled: -FIRDebugEnabled.
Yet in the debugging events console there is NOTHING. I see no devices available, no events being logged, absolutely 0 indication of anything connected. I must be missing something?
edit: I have been following this for setting up Debugging Events. https://firebase.google.com/docs/analytics/debugview#enabling_debug_mode
I am seeing events in the StreamView, but nothing in the debug view even though I have debug mode enabled.
Try this , This is work for me ,
Follow below steps ,
1.In Xcode, select Product → Scheme → EditScheme.
2.Select Run from left Menu and Select Arguments tab
In the Arguments Passed on + option
add -FIRDebugEnabled
For detail debug view follow steps DebugView track Firebase doc
To send an event in Xcode project follow code below,
Objective C
[FIRAnalytics logEventWithName:#"share_image"
parameters:#{#"name": name, #"full_text": text}];
Swift
Analytics.logEvent("share_image", parameters: ["name": name, "full_text": text])
For events log follow detail steps Log events in Application Firebase doc
Hope this will help someone.
Make sure to remove the OS_ACTIVITY_MODE:disable from the Environment Variables in your project scheme if you added it at some point.
Make sure to add ONE DASH before -FIRDebugEnabled
I wasted a whole day making silly mistake having missed that DASH
Hope that doesn't happen to others!
Now it doesn't matter much but still for the people who are getting errors on this issue. Debug mode of firebase analytics does not work sometimes due to issue in GoogleServices-Info.plist file
Simply makes these 2 changes.
Set IS_ANALYTICS_ENABLED to YES
Set FIREBASE_ANALYTICS_COLLECTION_DEACTIVATE to NO
I also have the same problems.
1 check your Cocopods' s Firebase version.
use pod update Firebase
List item
make sure that is the latest
2 open debug mode
In the Arguments Passed On Launch part
add - FIRDebugEnabled.
I made it possible by writing the following:
func application(_ application: UIApplication, didFinishLaunchingWithOptions, ...) {
// some other initialization
FirebaseApp.configure()
Firebase.Analytics.setAnalyticsCollectionEnabled(true)
}
Alternatively you can do that inside your AppDelegate:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
var newArguments = ProcessInfo.processInfo.arguments
newArguments.append("-FIRDebugEnabled")
ProcessInfo.processInfo.setValue(newArguments, forKey: "arguments")
}
---EXTRA---
And just some thoughts:
Regarding
Firebase.Analytics.setAnalyticsCollectionEnabled(true)
If we inspect the method:
So it's kind of POINTLESS...
Check if you have an ad blocker enabled while visiting the Firebase website.
I had uBlock origin enabled and it would block every page (Dashboard, Events, StreamView, DebugView...) and they'd all be blank.
Everything worked as expected as soon as I whitelisted it.
I recently had an issue where the Xcode console said everything was fine, and all was being logged and sent, and I had the "-FIRDebugEnabled" and I tried all other suggestions in this thread, but nothing worked.
Nothing was being sent to Firebase's DebugView.
Looking through my git-history, I determined the issue occurred due to a pod update, and the solution to my issue was another pod update.
I don't know which pod had failed, but I suspect either Moya, Alamofire or FirebaseAnalytics... after this, I'm strongly considering locking my pod-versions.
I had the same configuration as jaywant-khedkar, but no events or devices were showing up in the Firebase Debug View.
Found out that my pi-hole on my network was eating all the events.
So if if you have any kind of ad blocker on your network, disable it and try again.
Happy debugging!
If you've done everything that the Firebase documentation states, then it could be that you have the wrong "Debug Device" selected in Firebase Analytics' "Debug View". After changing the debug device in the top left, all my analytics events from before were displayed! So it wasn't that my events weren't being sent to Firebase, I was just seeing the wrong view. Image attached.
Had this issue a few days ago, after trying every solution I found on the internet and none of them working, these are the steps I used to finally enabled DebugView to find my device:
Close the app on the device you’re working on
Go to the Firebase console and sign out of your account
Sign back in again, go to the console and select the project you’re working on.
Again, not sure if this made a difference however do NOT click on DebugView item under the “Project shortcuts” list. Instead, click on the “Analytics” drop-down and select DebugView from there.
It may be possible that this process updates the data stream used in the DebugView page - after following these steps I noticed events which had been missed initially were now showing up - almost as if the event was sent/received properly however the DebugView wasn’t showing the correct data stream.
Bonus tip:
Had issues with this again today, and after signing out/in to Firebase the DebugView still wasn't finding my device. What fixed it was, on my device, move the app into the background i.e. swipe up from the bottom to go to the home screen...
When you re-open the app into the foreground, the DebugView should now start displaying events. I imagine this works because the action of moving the app into the background I believe triggers any saved events on the device to be sent to Firebase, essentially flushing the queue.
I am starting my App from XCode and with a specific behaviour it just disconnects and the app disappears from my IPAD screens.
So I guess the app crashes.
Now my question. Where Do I get this crashlog ? I already looked into
Window -> Devices -> choose my Ipad -> "View Device Logs" . But I cant see any actual crash log. I have some from earlier times, but my actual doesn't show up.
How do I get a crashlog ?
check if you have enabled Share with app developers option in settings. Privacy -> Analytics -> Share with App Developers.Xcode was not showing crash logs, enabling this helped me
You need to look at the device console under windows, devices in Xcode.
Its possibly saying something about code signing, bundle id's or missing libraries.
Try to delete the crash logs from "earlier times".
You have maximum amount of saved crash logs, and if you passed it - you won't see the new crash logs
I want to use Crashlytics on my application. I followed every step but I'm stuck on "Verifying Installation..." step.
What is the problem ?
setDebugMode = YES
set below code before [Fabric with:#[ TwitterKit ]]; if applied for twitter kit. Or you can simply past below code in didFinishLaunchingWithOptions.
// Swift
Crashlytics().debugMode = true
Fabric.with([Crashlytics.self()])
// Objective-C
[[Crashlytics sharedInstance] setDebugMode:YES];
[Fabric with:#[[Crashlytics class]]];
Now build and run your app and check fabric UI window, it will move ahead to complete screen.
I resolved the problem.
I put my code in applicationDidFinishLaunching(application: UIApplication) instead of func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?)
It seems silly but sometimes you need to make a code change (like a simple NSLog statement) to kick the verification.
If you're adding a new app you need to be an Admin of your organization but you may just be a User.
Just had the same issue on Mac.
In my case the guide shown in the Fabric application was completely missing a crucial step: there was nothing about adding the API key!
So make sure your API key is added to info.plist, otherwise the application gets stuck at verifying installation.
Simply login to Fabric and follow this manual installation guide to make sure everything gets done correctly. Once you complete the last step you can go straight to the dashboard.
I have occurred the same problem. I run the app on iPhone. After I deleted the app and pressed CMD + R on iPhone, the problem is solved.
If you have already installed twitter/Digits kit using fabric before, then you will find Fabric.with([Digits.self, Twitter.self]) in your "AppDelegate.swift" file . Replace it with the following code Fabric.with([Digits.self, Twitter.self, Crashlytics.self]) if you want to use all three. Now press Cmd + R to finish the installation.
Another possible solution is to run the app with connectivity on the device/simulator, as indicated in here.
It could be that the app was already added to your team's account and that all you needed was an access to it. Here's a thread about the same issue: https://twittercommunity.com/t/hmmm-seems-like-your-kit-isnt-activating/73601/9.