Cordova 12应用持续定位数小时后崩溃问题求助
跨平台Angular+Cordova应用长时间前后台定位后崩溃排查求助
我开发了一款基于Angular+Cordova 12的跨平台应用(支持iOS和Android),通过cordova-background-geolocation-plugin等插件实现持续数小时的前后台定位并存储数据,但应用运行数小时后会出现崩溃问题。目前使用Crashlytics做崩溃上报,但获取的有效信息不足以定位根因;Google控制台的部分错误已处理,但仍有无法排查的遗留问题。
基础环境与配置
- 平台:iOS、Android
- Cordova版本:12
- 框架:Angular + Cordova
- 使用的插件:
cordova-plugin-geolocationv5.0.0cordova-plugin-firebase-crashv8.0.0cordova-plugin-firebase-analyticsv8.0.0cordova-background-geolocation-pluginv2.0.10
- 定位权限与系统设置:
- 权限:
always - 自动启动:已启用
- 电池优化:已禁用
- 权限:
定位插件配置代码
options = Object.assign({ locationProvider: BackgroundGeolocation.DISTANCE_FILTER_PROVIDER, desiredAccuracy: BackgroundGeolocation.HIGH_ACCURACY, stationaryRadius: 10, distanceFilter: 10, interval: 10000, stopOnTerminate: true, notificationIconSmall: '@mipmap/notification_icon', notificationTitle: this.translateService.instant('playMode.title'), notificationText: this.translateService.instant('misc.active'), startForeground: true, pauseLocationUpdates: false, url: null, httpHeaders: {}, maxLocations: 10, postTemplate: null }, options);
Android性能相关截图
- Android Vitals 1:

- Android Vitals 2:

- Android Vitals 3:

问题复现情况
该崩溃无法稳定复现,通常在应用持续运行数小时后发生,难以精准定位触发条件与根因。
求助需求
- 崩溃原因分析思路:针对这类长时间后台定位场景的崩溃,有哪些常见排查方向?
- 监控方案优化建议:除现有Crashlytics和Google控制台外,还有哪些工具或配置能获取更精准的崩溃日志、内存/性能数据,帮助定位问题?
内容的提问来源于stack exchange,提问作者jdevuono
相关产品推荐
相关产品推荐

