I have updated the Crashlytics but still I am getting this error on launch:
Error: *** Terminating app due to uncaught exception \'FABException\', r
Try this:-
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
Fabric.with([Crashlytics.self])
return true
}
Try below code snippet, it may help:
For Swift:
//import related frameworks
import Fabric
import Crashlytics
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
Fabric.with([Crashlytics()])
//... your initialization code
return true
}
For Objective-C:
#import <Fabric/Fabric.h>
#import <Crashlytics/Crashlytics.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[Fabric with:@[CrashlyticsKit]];
//... your initialization code
return YES;
}
After spending 7 hours, I am able to solve the problem. Problem is: there are 2 Crashlytics files are in my code which are causing this problem. To solve the problem, I have deleted the older file and again integrate the Crashlytics.
I was having a crash on the same line, and it was because I called it BEFORE FirebaseApp.configure().
For anyone having the same issue, make sure you call them in this order:
FirebaseApp.configure()
Fabric.with([Crashlytics.self])