Wrong Symbol Files uploaded by firebase crash reporting - ios

When a crash gets uploaded to the firebase dashboard it always shows the message Upload symbol file to symbolicate future stack traces for UUID *******. However I did make sure that the symbol files got uploaded by looking in the Symbol Files tab. Something I noticed though was that the symbol files had a different UUID then what the message on the crash said. What might I be doing wrong here?
Something strange is that it seems like neither the UUID in uploaded symbol files nor in the message mentioned above is correct. I get a third UUID when I check it up locally by following this guide (basically running find . -iname *.app in ~/Library/Developer/CoreSimulator/Devices/).
I first got this issue in our app using swift 2 and xcode 7. However I also gets the same issue using a new firebase app (ios sdk v3.8) and a minimal xcode 8 project with swift 3 that is setup exactly as advised in the docs.
// AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FIRApp.configure()
return true
}
// ViewController.swift
override func viewDidLoad() {
super.viewDidLoad()
FIRCrashMessage("A test message")
fatalError()
}
// Run script in Build Phases that uploads symbol files
GOOGLE_APP_ID=our_google_app_id
"${PODS_ROOT}"/FirebaseCrash/upload-sym "serviceaccount.json"
// Podfile (using latest versions as of 2017-05-12, v3.17.0)
pod 'Firebase/Core'
pod 'Firebase/Crash'

I think maybe the path of "ServiceAccount.json" is wrong, please check again. It should be
"${PODS_ROOT}"/FirebaseCrash/upload-sym "/Path/To/ServiceAccount.json"
And you need also to add this in the script.
rm $HOME/Library/Preferences/com.google.SymbolUpload*

Related

Firebase Error While Adding To Project Using Cocoapods

Firstly, I would like to let you know that I have user Firebase Firestore several times before and have not faced such an error... I have followed the process correctly step by step and, because it was not working, I also tried to add firebase to an existing project and it has still given me errors. Below is there error which I get :
2020-05-21 09:32:15.775788+0530 Job App[61230:1180572] [GoogleDataTransport][I-GDTCOR001006] (/Users/tejas/Desktop/Files/Coding/Main Projects/Job App/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCOREvent.m:59) : There was an error saving the new counter value to disk.
Keep in mind that this error only pops up the first time I run the app on the simulator, then when I rerun it this error is gone. My app also doesn't even crash and the build always succeeds despite this error. Here is my app information:
Here is the code in my app delegate
import Firebase
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
{
// Override point for customization after application launch.
FirebaseApp.configure()
return true
}
My GoogleService-Info.plist file has the correct bundle ID :
Here is the file inspector of my GoogleService-Info.plist:
Here is the code inside my podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'
target 'Job App' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Job App
pod 'lottie-ios'
pod 'Firebase/Firestore'
end
Here is the message I get from the Firebase App Setup Wizard :
These are the pods under the pods folder :
It keeps on loading for a very long time and I'm sure that something is going wrong...
Do pod update and make sure that the GoogleDataTransport pod is at version 6.1.1.
This issue was fixed a few weeks ago. See https://github.com/firebase/firebase-ios-sdk/issues/5421

Crashes not showing up in Firebase console

I'm trying to transition my iOS app from Crashlytics to Firebase, since Crashlytics is going to be shut down in a month. I went through the steps described here:
https://firebase.google.com/docs/crashlytics/get-started-new-sdk
It all looked great until I tried my first test distribution. I added a piece of code that would crash the app on a button tap to test that I get the crashes from distributed apps. However, it didn't work. The app crashes, but I see no crash reports. I do see that Crash-free users percentage is going down though. So something is getting registered, but the actual crashes are not there.
My fists couple of test distributions were missing DSYMs. And under DSYMs tab I could even see the crash count. However, when I did upload the DSYMs the crashes still didn't appear.
Now I'm using a script that does the DSYM upload on archive, but crashes are not showing up still.
When I do a build using Xcode and force crash everything works as expected. It's only the distributed AdHoc builds don't show any crashes in the portal.
Any kind of help is highly appreciated.
If your forced crash didn't crash, crashed before you wanted it to, or you're experiencing some other issue with Crashlytics, you can enable Crashlytics debug logging to track down the problem.
To enable debug logging on your development device, specify the following command line argument in Xcode:
Crashlytics 3.11.1+
-FIRDebugEnabled
Previous versions
func application(_ application: UIApplication, didFinishLaunchingWithOptions
launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Initialize Firebase service.
FirebaseApp.configure()
Fabric.sharedSDK().debug = true
return true
}
Boom, after hours of trying and searching.
https://github.com/firebase/firebase-ios-sdk/issues/2901
Disabling bitcode for AdHoc builds fixed it for me.

Crashlytics : stuck on "Verifying Installation..." step

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.

How do I force a crash in Swift iOS app with Fabric SDK?

All I can find is Is there a quick way to force a crash? which says to:
[[Crashlytics sharedInstance] crash];
which I think in Swift would be
Crashlytics.sharedInstance.crash()
but this does not seem to exist. (perhaps the docs are out of date and no longer apply since Fabric gobbled up Crashlytics?)
I see that there is a Crashlytics.crash(self:Crashlytics) ...nevermind, friggin XCode's completion is always broken for me. See answer below.
If you are using the new Firebase Crashlytics SDK note that import Crashlytics has been replaced by import FirebaseCrashlytics. The crash() method is no longer available in the new SDK. As recommended by Firebase, simply use:
Swift:
fatalError()
Obj C:
assert(NO);
(if it's in a file other than your AppDelegate, you will need to import Crashlytics, then just do Crashlytics.sharedInstance().crash()
Create a Project and App in firebase
Add a new iOS app in the firebase console if you have existing firebase project or create firebase project and create new app in the firebase console.
Add Firebase to iOS App
Firstly in step 1, register your app by adding the bundle identifier while creating iOS app to firebase. In step 2, Download config file GoogleService-Info.plist add it to your workspace like in the image shown below.
Add Crashlytics SDK via CocoaPods
To get started, add the Crashlytics SDK framework files to your project. For most projects, the easiest way to do that is by adding the Crashlytics CocoaPods.
pod 'Firebase/Core'
pod 'Fabric', '~> 1.7.2'
pod 'Crashlytics', '~> 3.9.3'
Test your implementation
Enable Crashlytics debug mode: In order to enable crashlytics in debug mode we need to set Fabric.sharedSDK().debug mode to true in AppDelegate.swift.
import UIKit
import Firebase
import Crashlytics
import Fabric
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
Fabric.sharedSDK().debug = true
return true
}
Force crash to test implementation: While writing this article, I have one view controller with one button named (Click to crash app) in the middle of the viewController. For the testing purpose, when user click the button app crashed.
And View controller this below code and run once in simulator or device and check in Firebase dashboard .You find all crashes report.
import UIKit
import Crashlytics
class ViewController: UIViewController {
var name:String!
var number:Int!
override func viewDidLoad() {
super.viewDidLoad()
name = "12"
}
#IBAction func crashBtnAction(_ sender: Any) {
//creshreportMethod()
print("name of the value",name)
var myDict = [String:Any]()
myDict = ["name":number!]
print("my dict value",myDict)
}
}
Crashlytics can’t capture crashes if your build attaches a debugger at launch. Adjust your build settings to change the project’s debug information format:
With your project still selected in the Xcode Navigator, open the Build Settings tab.
Click All at the top of the tab to display all build settings.
Search for “debug information format”.
Set the Debug Information Format setting to DWARF with dSYM File.

how to integrate flurry in ios using swift language

I want to integrate flurry in ios using swift language.
I added the flurry sdk's two files : flurrylib.a and flurry.h and then entered my api key in project TestProject4-Bridging-Header.h
#import "Flurry.h"
I had the same issue and adding a bridging header worked for me. Here are the steps I followed.
Note: If you already have a bridging file, skip the steps 2 to 4
I dragged the Flurry folder to my Swift iOS project in XCode.
I created a bridging header file by creating a new Objective-C header file (in XCode menu it's File/New/File/iOS/Source/Header File)
I called the file name "PROJECTNAME-Bridging-Header.h" (replace PROJECTNAME with your XCode project name)
In Project Build Settings, I searched for "Swift Compile - Code Generation" and there in "Objective-C Bridging Header" I entered the name of my new bridging file (PROJECTNAME-Bridging-Header.h) for debug and release values.
Now, back in my bridging header file, I referenced the Flurry header file.
#import "Flurry.h"
In my AppDelegate.swift file, I could then call the Flurry methods using Swift:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// setup Flurry
Flurry.startSession(flurryKey) // replace flurryKey with your own key
Flurry.setCrashReportingEnabled(true) // records app crashing in Flurry
Flurry.logEvent("Start Application") // Example of even logging
Hope it helps someone.
Flurry Integration using Pods in Swift
You need to import Flurry SDK as Follows
import Flurry_iOS_SDK
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
Flurry.startSession("YOUR_API_KEY")
Flurry.logEvent("Started Application")
}
If you are attempting to log events in the 'didFinishLaunchingWithOptions' using Flurry SDK 6.0.0, this is not possible due to a bug in that version of the SDK. It is possible to start a session from this function however. I was told this information by a Flurry support rep, and confirmed it in my own testing.
You need to add a bridging header to your project. In that bridging header you import what you need in Swift and then you don't need to import it anywhere else.
The iBook on using Swift and Obj-C alongside has a very good explanation on this.
Actually, there is an explanation on Apple's Swift blog that says:
To be safe, all components of your app should be built with the same version of Xcode and the Swift compiler to ensure that they work together.
You can find more information here.

Resources