implementation 'com.tencent.bugly:crashreport:latest.release'
同意隐私协议后初始化
//初始化bugly
private void initBugly(){
// 创建UserStrategy对象
CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(this);
// 设置应用渠道
strategy.setAppChannel(PackageUtil.getUmengChannelName(this)); // 替换为实际的渠道名称
// 设置设备名称
strategy.setDeviceModel(Build.MANUFACTURER + " " + Build.MODEL); // 例如:"Samsung SM-G998B"
// 初始化Bugly
CrashReport.initCrashReport(getApplicationContext(),
Global.buglyAppId, // App ID
false, // 是否开启调试模式
strategy); // 用户自定义策略
}