Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Crash on Android at startup #1410

Open
2 of 3 tasks
rafaldziuryk opened this issue Jan 21, 2025 · 5 comments
Open
2 of 3 tasks

[Bug]: Crash on Android at startup #1410

rafaldziuryk opened this issue Jan 21, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@rafaldziuryk
Copy link

Required Reading

  • Confirmed

Plugin Version

flutter_background_geolocation: 4.16.0

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.5, on macOS 14.1 23B74 darwin-arm64, locale en)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.96.4)
[✓] Connected device (3 available)
    ! Error: Browsing on the local area network for iPhone (strugackis) 13. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for Mateusz appvinio. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for iPhone (Iphone12). Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!

Mobile operating-system(s)

  • iOS
  • Android

Device Manufacturer(s) and Model(s)

Samsung Galaxy A32 5G, Redmi Note 11 Pro 5G

Device operating-systems(s)

Android 13, Android 12

What happened?

So we got crash at app startup. We cannot reproduce it at ours own devices, but some customers meets this app behavior. We have around 3k geofence points. Hope stacktrace will be helpfully

Plugin Code and/or Config

await bg.BackgroundGeolocation.ready(
      bg.Config(
        reset: true,
        locationAuthorizationRequest: 'Any',
        desiredAccuracy: locationAccuracy,
        distanceFilter: 10,
        preventSuspend: true,
        stopOnTerminate: false,
        heartbeatInterval: 60,
        allowIdenticalLocations: true,
        geofenceModeHighAccuracy: true,
        startOnBoot: true,
        autoSync: false,
        logLevel: bg.Config.LOG_LEVEL_VERBOSE,
        persistMode: bg.Config.PERSIST_MODE_ALL,
        notification: bg.Notification(
          channelId: "geofence_notification_channel",
          channelName: LocaleKeys.home_screenTitle.tr(),
          title: LocaleKeys.home_screenTitle.tr(),
          text: LocaleKeys
              .nearbyObjectDetection_notifications_foregroundServiceMetroOrObject_description
              .tr(),
          smallIcon: 'drawable/ic_notifications',
          largeIcon: 'drawable/ic_notifications',
          priority:  bg.Config.NOTIFICATION_PRIORITY_MAX,

        ),
        disableStopDetection: true,
        pausesLocationUpdatesAutomatically: false,
        foregroundService: true,
        enableHeadless: false,
      ),
    );

Relevant log output

01-20 13:34:59.523 15715 15715 D TSLocationManager:   🎾  2:3 [LocationRequestService  startId: 3, eventCount: 1]
01-20 13:34:59.523  1735  1805 D ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = pl.xxx.xxx.test,userId = 0
01-20 13:34:59.523 15715 23580 I TSLocationManager: [c.t.l.l.TSLocationManager a]
01-20 13:34:59.523 15715 23580 I TSLocationManager: ╔═════════════════════════════════════════════
01-20 13:34:59.523 15715 23580 I TSLocationManager: ║ getCurrentPosition LocationResult: 3 (50ms old)
01-20 13:34:59.523 15715 23580 I TSLocationManager: ╠═════════════════════════════════════════════
01-20 13:34:59.523 15715 23580 I TSLocationManager: ╟─ 📍  Location[fused 52.247188,20.962121 hAcc=4.0 et=+4h56m58s901ms alt=140.90000915527344 vAcc=1.0 vel=8.1539596E-4 sAcc=3.7], time: 1737376499473
01-20 13:34:59.523 15715 23580 D TSLocationManager: [c.t.l.g.TSGeofenceManager setLocation] isMoving: false | stateChanged: false | timerExpired: false | elapsed: 1477
01-20 13:34:59.526 15715 23580 I TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult]
01-20 13:34:59.526 15715 23580 I TSLocationManager:   🔵  Acquired current position
01-20 13:34:59.526 15715 23580 D TSLocationManager: [c.t.l.l.TSLocationManager a] Median accuracy: 3.828
01-20 13:34:59.526  2703  2815 D BtGatt.GattService: onScanResult to scannerId: 9- eventType=0x10, addressType=1, address=367A6B_F, primaryPhy=1, secondaryPhy=0, advertisingSid=0xff, txPower=127, rssi=-44, periodicAdvInt=0x0
01-20 13:34:59.528 15715 23580 D TSLocationManager: [c.t.l.g.TSGeofenceManager setLocation] isMoving: false | stateChanged: false | timerExpired: false | elapsed: 1477
01-20 13:34:59.529 15715 23580 D TSLocationManager: [c.t.l.service.AbstractService a]
01-20 13:34:59.529 15715 23580 D TSLocationManager:   ⚙️︎   FINISH [LocationRequestService startId: 3, eventCount: 0, sticky: false]
01-20 13:34:59.530 15715 23861 I TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO persist]
01-20 13:34:59.530 15715 23861 I TSLocationManager:   ✅  INSERT: b4bc39cf-c10a-4fd5-8253-e3a77035dbc6
01-20 13:34:59.533  1735  1982 D InputReader: Btn_touch(9): value=0 when=17818.961581
01-20 13:34:59.533  1735  1982 I InputReader: Touch event's action is 0x1 (id=4, t=0) [pCnt=1, s=] when=17818.961581
01-20 13:34:59.534  1735  1981 I InputDispatcher: Delivering touch to (15715): action: 0x1, f=0x0, d=0, 'e7b11dd', t=1
01-20 13:34:59.534  1735  1796 I GestureDetector: obtain mCurrentMotionEventRaw. action: 1 id: 1005232
01-20 13:34:59.534  1735  1796 I GestureDetector: obtain mCurrentMotionEventRaw. action: 1 id: 1005232
01-20 13:34:59.536  2391 20013 D SecFgsManagerControllerImpl: onForegroundStateChanged: dialogShown:false, isForeground:true, packageName:pl.xxx.xxx.test , token:android.os.BinderProxy@dffa473, userId:0
01-20 13:34:59.537  1735  1805 D ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = pl.xxx.xxx.test,userId = 0
01-20 13:34:59.537 15715 15715 D TSLocationManager: [c.t.l.service.AbstractService b]
01-20 13:34:59.537 15715 15715 D TSLocationManager:   🎾  STOP [LocationRequestService startId: 4, eventCount: 1]
01-20 13:34:59.537  1735  1805 D ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = pl.xxx.xxx.test,userId = 0
01-20 13:34:59.537 15715 15715 D TSLocationManager: [c.t.l.service.AbstractService a]
01-20 13:34:59.537 15715 15715 D TSLocationManager:   ⚙️︎   FINISH [LocationRequestService startId: 4, eventCount: 0, sticky: false]
01-20 13:34:59.537 15715 15715 I ViewRootImpl@50572ef[MainActivity]: ViewPostIme pointer 1
01-20 13:34:59.540 15715 23861 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO destroyAll]
01-20 13:34:59.540 15715 23861 D TSLocationManager:   ✅  DELETED: (1)
01-20 13:34:59.547 15715 15715 D AndroidRuntime: Shutting down VM
01-20 13:34:59.547 15715 15715 E AndroidRuntime: FATAL EXCEPTION: main
01-20 13:34:59.547 15715 15715 E AndroidRuntime: Process: pl.xxx.xxx.test, PID: 15715
01-20 13:34:59.547 15715 15715 E AndroidRuntime: java.lang.IllegalArgumentException: Unsupported Number type: class java.math.BigDecimal
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:13)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:58)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:58)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:51)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at io.flutter.plugin.common.StandardMethodCodec.encodeSuccessEnvelope(StandardMethodCodec.java:3)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(Unknown Source:10)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at com.transistorsoft.flutter.backgroundgeolocation.BackgroundGeolocationModule$16.onSuccess(BackgroundGeolocationModule.java:4)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at com.transistorsoft.locationmanager.adapter.BackgroundGeolocation$a1$c.run(Unknown Source:8)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:942)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:99)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:226)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:313)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:8762)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
01-20 13:34:59.547 15715 15715 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)01-20 13:34:59.548 15715 15715 E TSLocationManager: [c.t.l.a.BackgroundGeolocation$w0 uncaughtException]
01-20 13:34:59.548 15715 15715 E TSLocationManager:   ‼️  Uncaught Exception: Unsupported Number type: class java.math.BigDecimal
01-20 13:34:59.548 15715 15715 E TSLocationManager: {"motionTriggerDelay":0,"crashDetector":{"gyroscopeThresholdHigh":20,"gyroscopeThresholdLow":4.5,"accelerometerThresholdHigh":20,"accelerometerThresholdLow":4.5,"enabled":false},"disableMotionActivityUpdates":false,"maxBatchSize":-1,"backgroundPermissionRationale":{"positiveAction":"Change to \"{backgroundPermissionOptionLabel}\"","negativeAction":"","title":"Allow {applicationName} to access this device's location even when closed or not in use?","message":"[CHANGEME] This app collects location data for FEATURE X and FEATURE Y."},"stationaryRadius":25,"authorization":{},"locationUpdateInterval":1000,"notification":{"layout":"","color":"","strings":{},"largeIcon":"drawable/ic_notifications","sticky":false,"channelName":"XXX","smallIcon":"drawable/ic_notifications","text":"Aplikacja jest uruchomiona","title":"XXX","priority":2,"actions":[],"channelId":"geofence_notification_channel"},"enableHeadless":false,"isMoving":false,"isFirstBoot":false,"activityRecognitionInterval":10000,"disableStopDetection":true,"locationTimeout":60,"minimumActivityRecognitionConfidence":75,"heartbeatInterval":60,"httpTimeout":60000,"maxRecordsToPersist":-1,"method":"POST","odometer":0,"schedulerEnabled":false,"disableLocationAuthorizationAlert":false,"autoSync":false,"disableAutoSyncOnCellular":false,"distanceFilter":10,"params":{},"autoSyncThreshold":0,"maxMonitoredGeofences":97,"disableElasticity":false,"headlessJobService":"com.transistorsoft.flutter.backgroundgeolocation.HeadlessTask","logMaxDays":3,"configUrl":"","didLaunchInBackground":false,"geofenceModeHighAccuracy":true,"desiredOdometerAccuracy":100,"trackingMode":1,"extras":{},"fastestLocationUpdateInterval":-1,"deferTime":0,"enableTimestampMeta":false,"disableProviderChangeRecord":false,"persistMode":2,"enabled":true,"locationAuthorizationRequest":"Any","locationsOrderDirection":"ASC","speedJumpFilter":300,"geofenceInitialTriggerEntry":true,"logLevel":5,"geofenceProximityRadius":1000,"persist":true,"allowIdenticalLocations":true,"batchSync":false,"elasticityMultiplier":1,"headers":{},"debug":false,"useSignificantChangesOnly":false,"stopTimeout":5,"stopOnTerminate":false,"geofenceTemplate":"","httpRootProperty":"location","url":"","stopOnStationary":false,"schedule":[],"scheduleUseAlarmManager":false,"stopAfterElapsedMinutes":0,"startOnBoot":true,"desiredAccuracy":-1,"maxDaysToPersist":1,"locationTemplate":"","foregroundService":true,"didDeviceReboot":false,"triggerActivities":"in_vehicle, on_bicycle, on_foot, running, walking"}
01-20 13:34:59.548 15715 15715 E TSLocationManager: java.lang.IllegalArgumentException: Unsupported Number type: class java.math.BigDecimal
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:13)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:58)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:58)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at io.flutter.plugin.common.StandardMessageCodec.writeValue(StandardMessageCodec.java:51)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at io.flutter.plugin.common.StandardMethodCodec.encodeSuccessEnvelope(StandardMethodCodec.java:3)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(Unknown Source:10)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at com.transistorsoft.flutter.backgroundgeolocation.BackgroundGeolocationModule$16.onSuccess(BackgroundGeolocationModule.java:4)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at com.transistorsoft.locationmanager.adapter.BackgroundGeolocation$a1$c.run(Unknown Source:8)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at android.os.Handler.handleCallback(Handler.java:942)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at android.os.Handler.dispatchMessage(Handler.java:99)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at android.os.Looper.loopOnce(Looper.java:226)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at android.os.Looper.loop(Looper.java:313)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at android.app.ActivityThread.main(ActivityThread.java:8762)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at java.lang.reflect.Method.invoke(Native Method)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
01-20 13:34:59.548 15715 15715 E TSLocationManager:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)01-20 13:34:59.551  1735 23878 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
01-20 13:34:59.551  1735  4537 D Debug   : low && ship && 3rdparty app crash, do not dump
01-20 13:34:59.551  1735  4537 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1252 com.android.server.am.AppErrors.crashApplicationInner:722 com.android.server.am.AppErrors.crashApplication:598 com.android.server.am.ActivityManagerService.handleApplicationCrashInner:10509 com.android.server.am.ActivityManagerService.handleApplicationCrash:10378
01-20 13:34:59.552  1735  4537 W ActivityManager: crash : pl.xxx.xxx.test,10528
01-20 13:34:59.552  1735  4537 W ActivityTaskManager:   Force finishing activity pl.xxx.xxx.test/pl.xxx.xxx.MainActivity
01-20 13:34:59.553  1735  4537 W WindowManager: Prepare app transition: mNextAppTransitionRequests=[TRANSIT_CLOSE], mNextAppTransitionFlags=TRANSIT_FLAG_KEYGUARD_GOING_AWAY_TO_LAUNCHER_WITH_IN_WINDOW_ANIMATIONS | TRANSIT_FLAG_APP_CRASHED, displayId: 0 Callers=com.android.server.wm.DisplayContent.prepareAppTransition:6493 com.android.server.wm.DisplayContent.requestTransitionAndLegacyPrepare:6509 com.android.server.wm.Task.finishTopCrashedActivityLocked:6797 com.android.server.wm.RootWindowContainer.lambda$finishTopCrashedActivities$19:2688 com.android.server.wm.RootWindowContainer.$r8$lambda$4nB35TzseTo6qyVD9NxDieoJN1Y:0
01-20 13:34:59.554  1735  4537 D ActivityTaskManager: scheduleTopResumedActivityChanged, onTop=false r=ActivityRecord{d74a8c u0 pl.xxx.xxx.test/pl.xxx.xxx.MainActivity} t2412 f}} caller=com.android.server.wm.ActivityTaskSupervisor.updateTopResumedActivityIfNeeded:2510 com.android.server.wm.TaskDisplayArea.positionChildTaskAt:602 com.android.server.wm.TaskDisplayArea.positionChildAt:537 com.android.server.wm.WindowContainer.positionChildAt:970 com.android.server.wm.Task.positionChildAt:3354 com.android.server.wm.Task.moveToFrontInner:6053
01-20 13:34:59.554  1735  4537 D InputDispatcher: Focused application(0): ActivityRecord{f8ca0f3 u0 com.sec.android.app.launcher/.activities.LauncherActivity} t2327}
01-20 13:34:59.555  1735  4537 V WindowManager: Changing focus from Window{e7b11dd u0 pl.xxx.xxx.test/pl.xxx.xxx.MainActivity} to null displayId=0 Callers=com.android.server.wm.RootWindowContainer.updateFocusedWindowLocked:595 com.android.server.wm.WindowManagerService.updateFocusedWindowLocked:6810 com.android.server.wm.ActivityTaskManagerService.setResumedActivityUncheckLocked:5766 com.android.server.wm.ActivityRecord.moveFocusableActivityToTop:3874
01-20 13:34:59.555  1735  4537 D MARsPolicyManager: onPackageResumedFG pkgName = pl.xxx.xxx.test, userId = 0
@rafaldziuryk rafaldziuryk added the bug Something isn't working label Jan 21, 2025
@christocracy
Copy link
Member

I have never heard of this before. None of this plugin's code implements java.math.BigDecimal.

Flutter (Channel stable, 3.19.5,

Latest flutter sdk is 3.27.2,.

@rafaldziuryk
Copy link
Author

I have some updates.

Crash occurs ONLY with minifyEnabled flag set to true. With flag set to false there is no problem.

@christocracy
Copy link
Member

Update to latest version of plug-in.

@rafaldziuryk
Copy link
Author

It doesn't help ;(

I have now: flutter_background_geolocation: 4.16.6

Do you need any other info?

@christocracy
Copy link
Member

Try flutter upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants