iOS (Fabric): Crashlytics crashing app on launch - ios

I have updated the Crashlytics but still I am getting this error on launch:
Error: *** Terminating app due to uncaught exception 'FABException',
reason: '[Fabric] It appears that "Crashlytics" is not a valid Fabric
Kit. Please make sure you only pass Fabric Kits to [Fabric with:].'
Here is my code:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
Fabric.with([Crashlytics.self])
return true
}

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])

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.

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;
}

Related

Firebase Crashlytics is not working in iOS

Implemented all steps from firebase doc :
Create App on firebase
add google plist in project
POD installed
Add FirebaseApp.configure() in didFinishLaunchingWithOptions
Added run script ${PODS_ROOT}/Fabric/run
update Debug information format
Please make sure Firebase configuration should be first line in the didFinishLaunchingWithOptions method of AppDelegate file.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
Fabric.sharedSDK().debug = true
return true
}

iOS Firebase app not configured after calling FIRApp.configure()

I have an iOS (Swift) app with the following code in the AppDelegate:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FIRApp.configure()
FIRDatabase.database().persistenceEnabled = true
return true
}
The app crashes on the persistenceEnabled = true line, with exception FIRAppNotConfigured, and the message "Failed to get default FIRDatabase instance. Must call FIRApp.configure() before using FIRDatabase."
Obviously, I've called FIRApp.configure() immediately before this, so the suggested solution is incorrect. The log output even shows "Configuring the default app" when that is called.
What might the problem be, and how could I resolve it so I can use the FIRDatabase?
Try:
override init() {
// Firebase Init
FIRApp.configure()
}

iOS: '[Fabric] It appears that "Crashlytics" is not a valid Fabric Kit [duplicate]

This question already has answers here:
iOS (Fabric): Crashlytics crashing app on launch
(4 answers)
Closed 4 years ago.
I have updated the Crashlytics but still I am getting this error on launch:
Error: *** Terminating app due to uncaught exception 'FABException',
reason: '[Fabric] It appears that "Crashlytics" is not a valid Fabric
Kit. Please make sure you only pass Fabric Kits to [Fabric with:].'
Here is my code:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
Fabric.with([Crashlytics.self])
return true
}
use this line of code. after a long try i found this solution xcode7, swift2/3
Fabric.with([Crashlytics()])
i hope it will fix your bug.
Please try:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?)
-> Bool
{
// Override point for customization after application launch.
Fabric.with([Crashlytics.class]) // <=========
return true
}

Parse setApplicationID - Xcode 6.3/iOS 8.3

Parse.setApplicationId("****", clientKey: "****") {
getting an error saying "expected declaration"... didn't have this issue on an earlier version of Xcode
All you have to do is
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
Parse.setApplicationId("Your_application_id",
clientKey: "Your_Client_Key")
return true
}
And import in your bridging header:
#import <Parse/Parse.h>

Unresolved identifier "PFFacebookUtils" in swift in Xcode6

I am trying to have users login to facebook with parse but am receiving the compiler error "Use of unresolved identifier" for PFFacebookUtils, Parse, FBAppCall, and an invalid DidBecomeActive
This question has been posted before and the solution was to add the parsefacebookutils framework into your project and import it into the header file. However, I have already added the framework to my project and imported it into my header file by adding the following to the my header.
#import <Parse/Parse.h>
#import <ParseFacebookUtils/PFFacebookUtils.h>
#import <FacebookSDK/facebookSDK.h>
I am still getting the error. The following is the code from my appdelegate file:
import UIKit
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
PFFacebookUtils.initializeFacebook()
Parse.setApplicationId("parseAppId", clientKey:"parseClientKey")
}
return true
}
func application(application: UIApplication,
openURL url: NSURL,
sourceApplication: String,
annotation: AnyObject?) -> Bool {
return FBAppCall.handleOpenURL(url, sourceApplication:sourceApplication,
withSession:PFFacebookUtils.session())
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
FBAppCall.handleDidBecomeActiveWithSession(PFFacebookUtils.session())
}
Could you please take a look at my code above? Not sure what the solution is.
Figured it out. You have to go into the Build Settings - Objective C Header and then type the path to your header in the debug name. For example ProjectName/HeaderName.h as according to where I had my file within my project. Normally you wouldn't have to do this, but it didn't populate for me when I created the header.

Resources