The crash service of Huawei AGC supports cross-platform. The documentation of Flutter plug-in integration has been compiled according to the documentation. Developers who need Flutter can refer to it or download the Demo for research.
The integration steps
1. Install the Flutter environment
Dev /docs/get-st download the Flutter SDK package.
Unzip the package to any folder.
B) Add the FLUTTER command file to the environment variable.
C) Download the Flutter and Dart plug-ins in Android Studio
2. Service opening & project creation
A) Create Android applications in AGC and open crash service, and open Huawei analysis service simultaneously
B) Create a Flutter project in Android Studio
C) Place agconnect-services.json file in Android/app directory
D) Configure Maven storehouse address and AGC plug-in address.
- Open the build.gradle file in the Android folder of the Flutter project.
Configure the Maven repository address in AllProjects -> Repositories.
Configure the Maven repository address in BuildScript -> Repositories.
Configure the AppGallery Connect plug-in address in BuildScript -> Dependencies.
- Add compile dependencies and AGC plug-in addresses.
Open the build.gradle file in the Android /app folder of the Flutter project and add the plugin address.
3. Integrate the SDK
Add the pub dependency for the crashed service to the pubspec.yaml file
Then click Pub get to synchronize
After the synchronization, you can view the library file has been downloaded.
4. Test functionality
You can set three buttons, two to control whether a crash report is reported, and the other to call setUserId to set a customized user ID, setCustomKey to set a customized key-value pair, LogLevel, and testIt to create a crash.
5. Packaging
As with Android, just hit Run in Android Studio
Crash Report View
After integration, click the button to create a crash and generate a custom report, which can be viewed on the AGC page
1, Choose the past hour:
2. View the crash details stack
3. View custom key-value pairs
4. View the custom log level
5. View the custom user ID
6. Generate a crash report for confusion in mapping file uploading and parsing:
For more details, see:
Huawei collapse AGC service document: developer.huawei.com/consumer/cn…
Huawei AGC – collapse service codelab:developer.huawei.com/consumer/cn…
Huawei AGC – collapse service Demo (Flutter) : developer.huawei.com/consumer/cn…
The original link: developer.huawei.com/consumer/cn… Author: Mayism