You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Cordova 12应用持续定位数小时后崩溃问题求助

跨平台Angular+Cordova应用长时间前后台定位后崩溃排查求助

我开发了一款基于Angular+Cordova 12的跨平台应用(支持iOS和Android),通过cordova-background-geolocation-plugin等插件实现持续数小时的前后台定位并存储数据,但应用运行数小时后会出现崩溃问题。目前使用Crashlytics做崩溃上报,但获取的有效信息不足以定位根因;Google控制台的部分错误已处理,但仍有无法排查的遗留问题。

基础环境与配置

  • 平台:iOS、Android
  • Cordova版本:12
  • 框架:Angular + Cordova
  • 使用的插件:
    • cordova-plugin-geolocation v5.0.0
    • cordova-plugin-firebase-crash v8.0.0
    • cordova-plugin-firebase-analytics v8.0.0
    • cordova-background-geolocation-plugin v2.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 1
  • Android Vitals 2:Android Vitals 2
  • Android Vitals 3:Android Vitals 3

问题复现情况

该崩溃无法稳定复现,通常在应用持续运行数小时后发生,难以精准定位触发条件与根因。

求助需求

  1. 崩溃原因分析思路:针对这类长时间后台定位场景的崩溃,有哪些常见排查方向?
  2. 监控方案优化建议:除现有Crashlytics和Google控制台外,还有哪些工具或配置能获取更精准的崩溃日志、内存/性能数据,帮助定位问题?

内容的提问来源于stack exchange,提问作者jdevuono

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.22 21:13:25