Flutter Firebase Crashlytics - Monitor crash logs in flutter apps easily using Crashlytics Package

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign [Music] and in this session we will look into how to integrate Firebase crashlytics in our slide wrap basically Firebase crashlytics is a lightweight real-time crash recorder that can be easily integrated in a flat trap in order to visualize the grass or exceptions happening in our flat wrap basically it provides with a clear log of the exception that is happening in our federal with the help of which we will be able to do the rework and update the app in the next release so the Firebase crashlytics is a free and open source service provided by the Firebase itself therefore we can go for integrating this Firebase class analytics to any of your app not just flutter but also for Android and iOS therefore in this video we'll look into how to integrate Firebase crash analytics in a flat wrap and see how we can utilize the crash that is happening in our flat wrap in real time let's try to understand this Firebase crash analytics with the help of a simple example here we have a sample flutter app we have to elevate the buttons and the first button is going to throw exception whenever it is pressed so inside the home page here we have two elevator buttons the first button whenever you press you just simply try to throw an exception just to mimic the process of any error logs happening in a federal we try to throw an exception and save the on-premet this button and let's press this and you see that in the debug console we get an exception happening here and the second button is going to take us to the second page where inside the second page we have the same kind of thing you can also take a look at that inside the second page which is stateless widget we have two elevator buttons the first button is going to throw an accession just the same way what we have in the home page and second button is going to throw a exception but in this case we specify it as a format exception just to distinguish two different accession and see how to visualize them in the Firebase class analytics dashboard so let's try to click this form exception in the second page now let's head over to the Firebase crash analytics dashboard and see how our logs are being maintained here the Firebase crash analytics dashboard can see that we have logs of two exception that has happened and the first is going to be the accession that occurred in the home page and if you click over that another key system we will be able to find that accession that has happened is just a simple exception thrown by the flatter framework this also provides with few other parameters like the device data and other metadatas just the same way sit back to our dashboard and in the second page we try to mimic the format exception and we get the same kind of thing here in the keys Tab and if you pay attention you will notice that second page we get the format exception being recorded So This is how you can easily get the logs of any issues happening in a flat wrap the help of the Firebase crash analytics this is basically pretty much how the crash analytics works here I have just shown you with a simple example of throwing exception as well as format exception with the help of the on press button but can be extended to a wide variety of large scale applications like any HTTP request access or network exception so on and so forth therefore without any further delay that's the only jump in the coding part and get this done first let's start by creating a flutter project and let's name it as Firebase crashlytics app here we say the home page will create a status widget class with empty scaffold just the same way we can create the second page which is again going to be a stateless widget class let's head over to the post pack and try adding two packages here and the packages are Firebase crash Analytics and the next one is the Firebase code now we have created the flutter project and now let's head over to the Firebase and create a project over there and here in the Firebase let's start by creating a project once we have created a Firebase project here in the Firebase console is click this flutter icon and let's try to integrate a flutter app and the Firebase so the integration plus is going to be very simple which is three simple steps we'll be able to easily integrate our Firebase with the foot wrap and if you remember we have also made a separate video of how to integrate our flat wrap and Firebase in three simple steps and if you want to take a look at that you can also do so I will also leave a link for the videos according to the top right the first process is we need to prepare our workspace which is already done in my case so let's skip that and and in the Second Step you need to run the fetterfly CLI basically we need to copy these two commands and try to run in the terminal so let's get back to our vs code here let's open the terminal let's paste that code here let's copy the second code and paste it now we have successfully integrated our flat app and Firebase you can also see that here we have the Firebase option.f file be generated automatically so with the help of which we will be able to now use any of the Firebase services in our fret wrap therefore let's complete the final step by heading over to the Firebase console third step is going to be the process of updating our main.file therefore let's copy this code and paste it in the main.f file now we can almost complete the process of integrating Firebase and our Fair trap therefore now let's head over to the Firebase dashboard and try to search for crash analytics here in the all products you'll be able to see the Firebase crash analytics here under the crash analytics you'll be able to see our apps being registered let's try running our Federal app now once you run out of a trap you will notice that here in the Firebase dashboard it has detected our app and is waiting for a crash so we need to invoke any crash manually in order to get the logs being displayed so let's head over to our vs code and try to create a manual crash in our flat wrap to get started with the coding side and say the federal personal text package you'll notice that they have provided with the documentation to get started for integrating the crash analytics so let's click this link here they have provided separate limitation for Android iOS and flutter and for the fighter framework the implementation is going to be very simple you just need to add the class around text to the flutter project and which is already been done by our site the second step is going to update the main method so let's copy this code and here in the main.f file let's paste this code here so with the help of which we can automatically catch all errors that are thrown within the threader framework in order to catch any asynchronous series that are in Handle by the flutter framework we just need to add this course number here in the main method let's just paste that code so that is the few lines of code we need to integrate in our main method in order to reboot any classes that is happening in our federal and the third step is going to force tester class therefore copy this code head over to the my home page say the body will have a text button which when pressed will throw a exception on clicking this you see an exceptional circuit you can and cache the exception here in the vs code therefore here in the debug console you will notice that an exception has occurred upon pressing the x button now let's see how it is being shown in that Firebase class analytics dashboard and here in the Firebase console there has been a crash in your front track and we also notice a log being created here if we click this it shows that inside my home page we have an exception happening so basically we got a log being created and just the same way here we have only one log being created for the home page let's have another button second page and try to create some other exception and see how it is been shown up in the console so back to our vs code instead of throwing an exception list provide a navigation to second page and here the second page this is the body we have a button basically an elevated button and in down press even let's try to create a format exception just for the testing purpose can have any text you want here that will be displayed in the Define based console as well so let's click this button and guess we should have a format exception being log the Firebase dashboard let's head over to Firebase console now let's refresh this app if you are unable to see any crash count here then try restarting your app once again so that might be a simple workaround so initially we used to have only one log here which is the home page exception now we have another log which is a crash happening in the second page as well if you click user now notice that under the key session we we get the format accession with the same kind of description what we have provided so by this you can extend this to even large scale application and try to create a clear log of the exceptions that aren't handled by the flatter framework hope you guys got a better understanding of how to integrate Firebase crash analytics in a federal app if you want me to make more detailed tutorial about this topic let me know them in the comments below hope you found this tutorial useful if you do so consider subscribing and I'll see you in the next video [Music]
Info
Channel: vijaycreations
Views: 7,883
Rating: undefined out of 5
Keywords: flutter, firebase, firebase crashlytics, crashlytics in flutter, flutter firebase crashlytics, firebase services, firebase flutter, flutter and firebase, flutter crash logs, monitor crash in flutter apps, monitor crash logs in crashlytics, app crash tutorial, firebase monitoring service, firebase and flutter, crashlytics, error handling, app dev, web dev, flutter crash handling, handling app crash, handling app crash in flutter, app crash, app crash prevention, flutter app dev
Id: p4pmAGn1Y00
Channel Id: undefined
Length: 9min 55sec (595 seconds)
Published: Tue May 02 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.