Android Oreo Issue
See original GitHub issueYour 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
- 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:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI Oreo support has been added in 3.x branch.
@mauron85
When I add the 3.x.x branch, reinstalling the plugin and updating everything I’ve got the message:
System info:
Ionic:
Cordova:
System:
NodeJS : v8.11.1 (C:\Program Files\nodejs\node.exe) npm : 5.6.0 OS : Windows 10