question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android Oreo Issue

See original GitHub issue

Your Environment

  • Plugin version: 2.3.5
  • Platform: Android
  • OS version: 8.1 Oreo (LineageOS build 15.1-20180609-UNOFFICIAL-m8)
  • Device manufacturer and model: HTC M8
  • Cordova version (cordova -v): 8.0.0
  • Cordova platform version (cordova platform ls): cordova platform ls
  • Plugin configuration options: Using Ionic 3.9.2
{
      desiredAccuracy: 10,
      stationaryRadius: 20,
      distanceFilter: 10,
      interval: 30000,
      stopOnTerminate: false
    }
  • Link to your project:

Context

Using the background geolocation provider to track individual users, on Android Oreo

Expected Behavior

On each call, my code runs

Actual Behavior

Crashes the App

Possible Fix

It appears the issue is to do specifically with Android Orea (SDK 27) as during debugging in Android Studio it is throwing:

android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=null pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x62 color=0x00000000 vis=PRIVATE)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1768)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

which is attached to https://stackoverflow.com/questions/47531742/startforeground-fail-after-upgrade-to-android-8-1 (albeit it is noted the code snippets are Kotlin and not java, though the principle is the same).

Steps to Reproduce

  1. Run basic example on Android 8.1

Context

Debug logs

android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=null pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x62 color=0x00000000 vis=PRIVATE)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1768)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mauron85commented, Aug 20, 2018

FYI Oreo support has been added in 3.x branch.

0reactions
tupizzcommented, Nov 3, 2018

@mauron85
When I add the 3.x.x branch, reinstalling the plugin and updating everything I’ve got the message:

console.warn: Native: tried calling BackgroundGeolocation.configure, but the BackgroundGeolocation plugin is
[app-scripts]             not installed.
[app-scripts] [18:53:21]  console.warn: Install the BackgroundGeolocation plugin: 'ionic cordova plugin add
[app-scripts]             cordova-plugin-mauron85-background-geolocation'
[app-scripts] [18:53:21]  console.log: plugin_not_installed
[app-scripts] [18:53:21]  console.warn: Native: tried calling BackgroundGeolocation.start, but the BackgroundGeolocation plugin is not
[app-scripts]             installed.
[app-scripts] [18:53:21]  console.warn: Install the BackgroundGeolocation plugin: 'ionic cordova plugin add
[app-scripts]             cordova-plugin-mauron85-background-geolocation'

System info:

Ionic:

  • ionic (Ionic CLI) : 4.2.1 (C:\Users\Usuario\AppData\Roaming\npm\node_modules\ionic)
  • Ionic Framework : ionic-angular 3.9.2
  • @ionic/app-scripts : 3.1.11

Cordova:

  • cordova (Cordova CLI) : 8.1.1 (cordova-lib@8.1.0)
  • Cordova Platforms : android 7.1.1, browser 5.0.4
  • Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 1.2.1, (and 8 other plugins)

System:

NodeJS : v8.11.1 (C:\Program Files\nodejs\node.exe) npm : 5.6.0 OS : Windows 10

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 Common Android 8.1 Oreo Problems & How to Fix Them
Wi-Fi problems are extremely common Android issues and they can popup anytime without warning. If you start noticing slow speeds or dropped ...
Read more >
Android 8.0 Oreo problems list, Dec 2022 - Product Reviews Net
Android 8.0 Oreo problems include: – Installation problem with a 'Couldn't Update' message popping up on screen. – Battery life drain complaints on...
Read more >
Android 8.0 Behavior Changes
System and API behavior changes that can affect apps running on Android 8.0 Oreo. ... To avoid issues arising from such a misidentification, ......
Read more >
18 Android 8 Oreo & 9 Pie Update Issues And Their Fixes
Learn the most common Android Oreo (8.0) and Android Pie (9.0) issues and their fixes that occur while updating Android mobile phone and ......
Read more >
Android 8.0 Known Issue: WebView issue on work profile
An issue has been brought to our attention: On Android Oreo devices with multiple users, where Chrome is not enabled for all of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found