main function in your project's main.dart file:import 'package:bugly_pro_flutter/bugly.dart';void main() {Bugly.setSdkRegion(SdkRegion.BUGLY_CLOUD); // Sets the reporting domain.BuglyOptions options = BuglyOptions(appId: '', appKey: '', bundleId: '');options.monitorTypes = [MonitorType.launchMetric,MonitorType.looperMetric,MonitorType.looperStack,MonitorType.exception];options.userId = 'pro_tester';Bugly.init(options, appRunner: (){runApp(const MyApp());},beforeInitRunner: (options){options.appId = 'afxxxxb01'; // appid of the registered productoptions.appKey = 'aef434ba-xxxx-xxxx-xxxx-030b10aae88b'; // appkey of the registered productoptions.bundleId = 'com.xxx.bundleid';});}
import 'package:bugly_pro_flutter/bugly.dart';void main() {BuglyOptions options = BuglyOptions(appId: '', appKey: '', bundleId: '');options.monitorTypes = [MonitorType.launchMetric,MonitorType.looperMetric,MonitorType.looperStack,MonitorType.exception];options.userId = 'pro_tester';WidgetsFlutterBinding.ensureInitialized();final zone = Zone.current; // !!!!!! Capture the zone!!!!!!Bugly.init(options, appRunner: (){// runApp(const MyApp());zone.run(() => runApp(const MyApp())); // !!!!!!Change to run runApp within the zone here!!!!!!},beforeInitRunner: (options){options.appId = 'afxxxxb01'; // appid of the registered productoptions.appKey = 'aef434ba-xxxx-xxxx-xxxx-030b10aae88b'; // appkey of the registered productoptions.bundleId = 'com.xxx.bundleid';});}
Abort message: 'JNI DETECTED ERROR IN APPLICATION: java_class == null in call to GetStaticMethodID, and code obfuscation is enabled in the project, you need to add Bugly-related classes to the keep allowlist.-keep class java.com.tencent.bugly.**{*;}
Clean Build (Cmd + Shift + K) and then rerun.flutter pub get after integrating the Flutter SDK reports dependency conflicts, try adjusting the conflicting library version to match your project's requirements. For example, if the business depends on uuid library 4.4.2 but the Flutter SDK depends on 3.0.6, running flutter pub get will result in an error. To resolve this, add the following content in pubspec.yaml. If the issue persists, please submit a ticket to contact us.# Force overwrite the uuid dependency to version 4.4.2.dependency_overrides:uuid: ^4.4.2
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback