Skip to content

[Bug]: App Crash reported in firebase, and seen in person #2516

@RemiHin

Description

@RemiHin

Required Reading

  • Confirmed

Plugin Version

5.0.3

Mobile operating-system(s)

  • iOS
  • Android

Device Manufacturer(s) and Model(s)

Samsung S25, Xiaomi 15, Samsung S24 Ultra, Samsung S23, Galaxy Z Flip6, OnePlus 13, Galaxy S25 Ultra

Device operating-systems(s)

Android 16

React Native / Expo version

0.83.2

What happened?

I have seen one case of this several times on my wifes phone, she activated the plugin, then put the app in the background, then when returning the app to the foreground after a while the app first seems to freeze, then after a couple of seconds, the app crashes.

This is the log from firebase. I have seen this error a lot since updating the package to 5.0.3

Plugin Code and/or Config

{
            
            desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
            preventSuspend: true,
            pausesLocationUpdatesAutomatically: false,
            distanceFilter: 5,
            fastestLocationUpdateInterval: 3000,
            locationUpdateInterval: 5000,

            disableElasticity: true,
            elasticityMultiplier: 2,
            stationaryRadius: 10,
            stopTimeout: 5, // 5 minutes
            triggerActivities: 'on_foot, walking, running',

            heartbeatInterval: 60,

            enableHeadless: false,
            stopOnTerminate: true,
            startOnBoot: false,

            activityType: BackgroundGeolocation.ACTIVITY_TYPE_FITNESS,

            locationAuthorizationRequest: 'Always',
            locationAuthorizationAlert: {
                titleWhenInUse: i18n.t('permissions.locationAlert.titleWhenInUse'),
                titleWhenOff: i18n.t('permissions.locationAlert.titleWhenOff'),
                instructions: i18n.t('permissions.locationAlert.instructions'),
                cancelButton: i18n.t('permissions.locationAlert.cancelButton'),
                settingsButton: i18n.t('permissions.locationAlert.settingsButton'),
            },

            foregroundService: true,
            notification: {
                title: 'WandelWeb',
                text: currentNotificationTextRef.current,
                priority: BackgroundGeolocation.NOTIFICATION_PRIORITY_MAX, // Highest priority
                channelName: 'WandelWeb GPS Tracking',
                sticky: true,
                ongoing: true, // Makes it harder to dismiss
                smallIcon: 'ic_launcher',
                largeIcon: 'ic_launcher',
                color: '#4CAF50'
            },

            // Batterij optimalisaties
            saveBatteryOnBackground: false,
            logLevel: BackgroundGeolocation.LOG_LEVEL_OFF,

            backgroundPermissionRationale: {
                title: i18n.t('permissions.backgroundRationale.title'),
                message: i18n.t('permissions.backgroundRationale.message'),
                positiveAction: i18n.t('permissions.backgroundRationale.positiveAction'),
                negativeAction: i18n.t('permissions.backgroundRationale.negativeAction'),
            },

            debug: false,
        }

Relevant log output

Fatal Exception: java.util.ConcurrentModificationException:
       at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1111)
       at java.util.ArrayList$Itr.next(ArrayList.java:1064)
       at com.transistorsoft.locationmanager.lifecycle.LifecycleManager.c(r8-map-id-790b64259fb0934ba91077229d71609bb1a84d45f3c741a7714bb010b1bb7004:8)
       at com.transistorsoft.locationmanager.lifecycle.LifecycleManager$b.run(r8-map-id-790b64259fb0934ba91077229d71609bb1a84d45f3c741a7714bb010b1bb7004:3)
       at android.os.Handler.handleCallback(Handler.java:995)
       at android.os.Handler.dispatchMessage(Handler.java:103)
       at android.os.Looper.loopOnce(Looper.java:267)
       at android.os.Looper.loop(Looper.java:360)
       at android.app.ActivityThread.main(ActivityThread.java:10088)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:616)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1113)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions