3

In our project we were used the fabric for reporting crash, after that we have migrated the fabric with firebase and not removed the fabric due to the firebase was in beta. Right now we are trying to remove the fabric and crashlytics dependencies in the entire code:

#pod 'Fabric', '1.10.2'
#pod 'Crashlytics', '3.14.0'

And used the below dependencies for Firebase Crashlytics.


pod 'FirebaseCrashlytics', '4.5.0'
pod 'FirebaseAnalytics', '6.8.0'
pod 'FirebaseCore', '6.10.1'
pod 'FirebaseMessaging', '4.6.2'

For initializing the crashlytics I have added the script in the build phases:

"${PODS_ROOT}/FirebaseCrashlytics/run"

Input Files:


${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME} $(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

Already we have placed the crash in staging/production environment during fabric integration, so when migrating the firebase all the crashes get configured. But when I place the new crash, the crash not added in the crashlytics report in staging/production environment.

When I run the app and crash the app in the development environment crashlytics is not get configured.

For development: enter image description here

Ref:https://firebase.google.com/docs/crashlytics/get-started?authuser=0

Note : I am able to place the crash using fabric:
 $

{PODS_ROOT}/Fabric/run API_KEY BUILD_SECRET

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
HariKarthick
  • 1,369
  • 1
  • 19
  • 47
  • 1
    Try to run an app from simulator or device not from Xcode because you have to detach debugger at runtime to crashlytics work as already mentioned [here](https://firebase.google.com/docs/crashlytics/test-implementation?platform=ios#test_it_out) – Kishan Bhatiya Sep 02 '20 at 08:57
  • Thanks, @KishanBhatiya. I tried running the app form device like mentioned above, but still, it's not configured. – HariKarthick Sep 02 '20 at 09:35
  • `but still, it's not configured` means? – Kishan Bhatiya Sep 02 '20 at 09:37
  • still, it's showing the "Add the SDK, then build, run and crash your app View the SDK docs. We'll be listening for your app to communicate with our servers." – HariKarthick Sep 02 '20 at 09:39
  • 1
    Thank you so much @KishanBhatiya. I am able to see the crash now after 5 mins. – HariKarthick Sep 02 '20 at 09:48

2 Answers2

3

For some reason following the Firebase docs did not work for me as I had to do a few additional things for the "Add the SDK" loading screen to disappear on the Firebase portal and show me the crashes.

In addition to what the Firebase docs say, I did the following in addition with the help of this answer

  1. Go to Build Settings -> Debug Information Format -> Set all of them to DWARF with dSYM file
  2. Go to Build Phases -> Add an additional run script and input the following
${PODS_ROOT}/FirebaseCrashlytics/upload-symbols -gsp ${PROJECT_DIR}/Your_path/GoogleService-Info.plist -p ios ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}

Remember to replace Your_path appropriately for your project

  1. Stage a crash in your application as described here

  2. Disconnect your device / simulator from the debugger AKA launch it on your own rather than running it from XCode and then perform the crash

  3. I was now able to see the above loading disappear and I could see my crash statistics instead

Shawn Frank
  • 4,381
  • 2
  • 19
  • 29
1

As mentioned in Firebase Docs, When you are running an app using Xcode Simulator, an initial instance of your app which includes a debugger that interferes with Crashlytics also created. With a debugger, Crashlytics can't see crashes. So you have to detach a debugger and run the app directly from a simulator or device.

Kishan Bhatiya
  • 2,175
  • 8
  • 14