Intermediate: Integration of Huawei Crash Service in Flutter (Cross platform)
In this article, we will be implementing Huawei Crash Service in flutter application. It is a responsibility of the developer to build crash free i.e. unexpected exit of application, it is very difficult to find the cause of the crash in huge application code base. This unexpected crash makes app users annoying and may lead to business loss and reduce market value of the product and the company. To avoid such crashes Huawei provides Crash service which makes developer to find the crash and cause of unexpected exit of the application in AG-console. Crash SDK provides very simple and developer need not code much to implementation crash service. You can also download the detailed crash report whenever required.
Introduction
In this article, we will be implementing Huawei Crash Service in flutter application. It is a responsibility of the developer to build crash free i.e. unexpected exit of application, it is very difficult to find the cause of the crash in huge application code base. This unexpected crash makes app users annoying and may lead to business loss and reduce market value of the product and the company. To avoid such crashes Huawei provides Crash service which makes developer to find the crash and cause of unexpected exit of the application in AG-console. Crash SDK provides very simple and developer need not code much to implementation crash service. You can also download the detailed crash report whenever required.
Development Overview
You need to install Android studio and I assume that you have Added dart and flutter plugin installed in android studio and prior knowledge about dart language.
Hardware Requirements
- A computer (desktop or laptop) running Windows 10.
- A Huawei phone (with the USB cable), which is used for debugging.
Software Requirements
- Java JDK 1.7 or later.
- Android studio or Visual Studio or Code installed.
Integration Preparations
1. Create a project in AppGallery Connect.
2. Create flutter project.
3. Enable the Crash service in the Quality section in AG-console.

4. Add the required dependencies to the build.gradle file under project level
Add below dependency in build.gradle under app level
5. Add the below permissions to AndroidManifest.xml file under app/src/main folder.
6. Add the agconnect_crash in pubspec.yaml.

Result









Tips and Tricks
- Add latest HMS crash dependency in build.gadle file.
- Do not forget to click pug get after adding dependencies.
- Add agconnect-services.json file to project.
Conclusion
In this article, we have learnt integration of Huawei Crash service which provides developers to quickly detect, locate and fix the crash or unexpected exit of application. Hence improves stability and reliability of application.
Thanks for reading, please provide your valuable feedback and like.
Reference