WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Context.startForegroundService() did not then call Service.startForeground() on Android 8.1 #121

@FranciZ

Description

@FranciZ

Your Environment

  • Plugin version:1.8.0
  • Platform: Android
  • OS version: 8.1.0
  • Device manufacturer / model: Pixel XL 2
  • Nativescript version (tns info): 4.1.2
  • Plugin config
{
            debug: false,
            desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
            stationaryRadius: 10,
            distanceFilter: 5,
            activityRecognitionInterval: 5000,
            notificationText: 'Loco service activated',
            notificationIcon: 'drawable/ic_notification'
}

Expected Behavior

App shouldn't crash.

Actual Behavior

App crashes throwing Context.startForegroundService() did not then call Service.startForeground() error.

This library is the only background service I'm using in the app so I'm assuming there's an issue here.

Steps to Reproduce

It's random, it happens every once in a while when putting the app to background and back to foreground.

Context

Nothing particular.

Debug logs

Fatal Exception: android.app.RemoteServiceException
Context.startForegroundService() did not then call Service.startForeground()
android.app.ActivityThread$H.handleMessage (ActivityThread.java:2101)
android.os.Handler.dispatchMessage (Handler.java:108)
android.os.Looper.loop (Looper.java:166)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions