Ionic App | Firebase Crashlytics does not work with Crash Reporting? - firebase

I'm using #ionic-native/firebase plugin in our Ionic App, and crash reporting is included in this plugin. Since Firebase Crash Reporting will no longer be accessible after September 9, we are trying to switch to Firebase Crashlytics. But we're not getting any crash data on Crashlytics dashboard. Here's what I've tried:
First, I followed Get started with Firebase Crashlytics, built and ran our App.
Then I found I could access Crashlytics dashboard, which I thought the SDK was implemented successfully. But after I crashed the app for a few times and waited for at least one day, but nothing showed up on either Crash Reporting or Crashlytics dashboard.
Then, I reversed the changes made to our app and built & ran again, firebase console didn't change back. I found this plugin cordova-plugin-firebase-crash and installed it to my app successfully.
After crashing the app, almost immediately I got the crash data on Crash Reporting dashboard but no crashes on Crashlytics dashboard, but I could see the change on Crash-free statistics graph, which is weird. Now the Crashlytics dashboard looks like this:Crashlytics dashboard
.
My question is: does crashlytics not work when crash reporting is used in the App? Or did I implement crashlytics wrong? Any help would be appreciated.

For those who are stuck with cordova , try get capacitor (which also supports cordova out-of-box)
There’s a plugin for crashlytics
once you got the stuff set up you'll only have to
import { Crashlytics } from 'capacitor-crashlytics';
const crashlytics = new Crashlytics();
//
// log user
crashlytics
.logUser({
name: "John Doe",
email: "john#doe.com",
id: "123"
})
.then(() => alert(`user logged`))
.catch(err => alert(err.message));
//
// force a crash
crashlytics.crash();
Check this out to learn more
https://github.com/stewwan/capacitor-crashlytics
side note: I’m the creator, feel free to PR or file issues.

Finally I found my mistake.
I am using cordova-plugin-firebase and to check the crash I am using the logEvent and logError method of that plugin ttlo check whether it is reflecting to console or not but I for the first time I am not able to see any of the log.. I waited like 24 hours but then I read the documentation about the Non-Fatal error here and check the Firebase-plugin.java and come to conclution that this 2 methods are basically logging the non-fatal error so you have to apply filter in firebase console to see you manual logs like this..
And when you app actually crashed by any reason you will defnalty see the logs in Crashes section..

You can use the Sentry Capacitor plugin here.
Sentry's Capacitor SDK enables automatic reporting of errors,
exceptions, and messages. It includes native crash support on iOS and
Android.
Official doc: https://docs.sentry.io/platforms/javascript/guides/capacitor/

Related

Firebase Crashlytics not showing crash reports even though it has crashes

We have a project where we use Firebase Crashlytics to collect crash reports from our iOS and Android app. Currently, the console is not showing any crash reports. Initially we assumed something was wrong with our project setup, but today I discovered that Crashlytics actually has been receiving the crash data, since I can see it on the Project Overview page:
However, when I open the Crashlytics page it is empty (it only shown me the guide on how to integrate Crashlytics in your app):
This is the case for both out iOS and Android app. We also have another project that is set up in the same way, but here the reports are shown correctly.
Is there perhaps some console configuration we are missing?

Firebase Crashlytics For Xamarin iOS- Missing dSYM files

Need Help !!
We are getting caution message on top of the Dashboard in Firebase Crashlytics. We are tried with different technical advises in different forums.
But nothing has worked out for us. We are still seeing the caution message at the top (in red strip) and crashes count is incrementing on every crash but doesn't come to Dashboard.
Here we go with our Firebase Crashlytics integration with project :
We are using Firebase Crashlytics with Xamarin Forms project to record any crashes in Mobile Application.
Since, Firebase Crashlytics SDK & Documentation are mostly on Native Platforms (Android & iOS). But, we still got provision to get packages from NuGet.
Here is the checklist which ensures we are on right direction:
1) Is App released with proper Apple Distribution Provision Profile and Certificate- YES
2) Is Distribution Provision Profile valid in terms expiration date - YES, it is valid till Next year from now.
3) Is GoogleService-Info.plist correctly placed. YES- it was downloaded from Crashlytics console with proper identifier configured. File was placed at root of iOS Project and set Build Action as BundleResource.
4) Did we call required initialisation function at proper place. - YES. Below set of codes ensures we initialised properly Firebase Crashlytics in AppDelegate.cs class.
5) Is your build configuration rightly placed in Release mode. YES
6) Important Point: Firebase Crashlytics was able to process the reported crashes with earlier version of iOS build which were having same project and package configuration and we could able to see the Crashes in readable format till for immediate previous versions.
But suddenly it stopped working when we promoted to production in AppStore (means LIVE in AppStore)
7) Have we uploaded to dSYM file manually to Firebase Crashlytics - YES we TRIED. We followed the steps to upload dSYM using XCode-SWIFT project with POD files.
Here is the setup and step.
POD was installed in appropriate XCode workspaces.
Run Script was executed with recommended POD commands.
Build was succeeded.
Hence, as you see, we are practiced with every advises whichever mentioned in any forum. We have applied, but we don't see, it is coming to Crashlytics Dashboard even then.
Try below command. May be help full.
msbuild "/Users/xxx/projects/myApp/myApp/myApp.iOS/myApp.iOS.csproj" /t:"build" /p:Configuration="AppStore" /p:Platform="iPhone" /p:BuildIpa=true /p:FirebaseCrashlyticsUploadSymbolsEnabled=true
I have tried this command and it is working in my case. I get it from this git thread : https://github.com/xamarin/GoogleApisForiOSComponents/issues/386

Firebase Crashlytics stuck adding SDK

I'm trying to add the Crashlytics SDK to my Android app, but it seems to be having trouble communicating with the Firebase servers. I've followed all of the instructions per the docs, but the Crashlytics tab in my console has been stuck on this screen for about 6 or so hours:
crashlytics add sdk screen.
I would (ideally) get this to just work™️, but if not then I'd like to be able to restart the process, but I also don't know how to do that.
Thanks in advance!!
I figured it out - I was mistakenly using the same appplicationID as another one of my projects, so Firebase was getting confused - making an entirely new project with a different applicationID fixed my problem.
if you followed all the steps as latest documentation..crash the app( use fatalError() for crash) using button action, this trick works for me.
https://firebase.google.com/docs/crashlytics/get-started?platform=ios&authuser=0#force-test-crash
For me Create a crash on button in project Relaunch application by simulator not by Xcode and It worked for me.

Firebase doesn't show connected user

I'm learning to work with Firebase within Unity.
1. What I've done so far -
1.1 Created a Firebase and Unity project
1.2 copied the json file into Assets folder
1.3 imported Firebase packages
1.4 downloaded jdk-8 and created JAVA_HOME variable
1.5 Created a c# script and put it into a gameobject (from the Firebase tutorial)
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task => {
FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
});
1.6 switched to Android environment and built with result "SUCCESSFUL" - with no errors whatsoever.
2. The issue -
2.1 I logged into my project on firebase and ran the code (from pc on Unity) and on my Android device, but firebase doesn't show any users connected :( (waiting for analytics).
2.2 Firebase
What am I doing wrong?
The app actually works! It just doesn't show connected users.
I went straight ahead and started logging data to the Real Time Data Base and it worked - data was added but it keeps saying "0 User Connections".
Is that a bug?
The first thing to do is double check that the task completed successfully. You can do this by saying:
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task => {
if (task.Exception != null) {
Debug.LogError($"Task failed with {task.Exception}");
}
else if (task.Result != DependencyStatus.Available) {
Debug.LogError($"Firebase dependencies not available with {task.Result}");
}
else {
Debug.Log("Everything's good!");
FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
}
});
You'll want some way to listen to these messages on device, and you can sometimes get the Unity Console to track those. But these days I like to install the Android Logcat plugin. You can find it in the Package Manager built into Unity:
It'll give you this cool window under Window/Analysis/Android Logcat:
And usually automatically hooks up to any game I run with the "Build & Run" button in Unity.
This will give you a ton of useful information about your game and perhaps shed a little more light on what's going on if you either hadn't been seeing the Unity logs or had been running adb logcat from the command line.
If you don't see any helpful logs there, there's a button in that logcat window called "Open Terminal". The claim is that it will open a terminal with adb in the $PATH so you can run android commands (in my own testing, the window appeared behind Unity, so I didn't think it was working. Then using which adb it still showed my system install of adb.).
With this open, follow the instructions for debugging analytics on Android. You'll want to type adb shell setprop debug.firebase.analytics.app <package_name> where <package_name> would be whatever your game's package name is (in my screenshot above, it's com.Firebase.PopsiclePlatformer).
Then you can open "Debug View" in the Firebase Console and see events in near real time:
I didn't include these steps in my video because it was difficult to embed both iOS and Android instructions in a timely manner, it should typically just work although Analytics doesn't guarantee realtime event reporting, and the focus wasn't on Analytics. I'm looking at making an updated thing just for Analytics, so I'm really curious if all of this helps you!
There are a couple of other things to check:
You might want to make sure you hooked up Google Analytics (this wasn't a thing when I recorded my video), but I don't think you could get the linked screenshot if you did.
You may also have to run "Force Resolve" from the External Dependency Manager, but that will be much more obvious if you have good logging going:
--Patrick

Firebase not reporting android activity

We are using Firebase for push notifications for Android and iOS, and all the notifications are working perfectly.
But when I log into firebase, and try to see the activity in “Streamview”, I see only iOS activity, and nothing for Android.
I do see the activity in Cloud messaging’s Report section, for both iOS and Android.
The application we have built is built using Xamarin forms.
One thing to note from the Firebase console is that it doesn’t appear as though the console recognizes that SDK setup was fully complete.
When going into the link where it says “Continue SDK Setup”.
Finally, when proceeding to step #4 it tries to verify that there has been communication between the app and Google’s servers and it doesn’t seem to find anything and it just sits there looking.
Notifications appear to work, but the app just doesn’t seem to be registering as being used under the Android side.
Any pointers in this direction will be very helpful.
i don't have any idea what is wrong here.
I want to watch complete report of my push notifications sending count, for both platform Android and iOS. but i am getting only iOS report in stream view tab not for Android.
I made the comment above and now I have found an answer, at least for my situation. I had added Xamarin.Firebase.Core to the PCL project as the documentation suggests. Later I saw documentation for Android Java that showed Firebase Core being added to the gradle file at the app level. So I added Xamarin.Firebase.Core NuGet package to the Android project also and now I can see data for Android in the Firebase Console.

Resources