Skip to content
This repository was archived by the owner on Jan 14, 2018. It is now read-only.

Android O (8.1.0) : invalid channel for service notification #473

@MS893

Description

@MS893

I've got this new error for users using android 8.1.0 :
"android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=null..."

I can reproduce the error on emulator using API level 27.

I've found this topic :
https://stackoverflow.com/questions/47531742/startforeground-fail-after-upgrade-to-android-8-1

The error is not systematic and depend on the robospice service : if the service is completed when onDestroy is called => no crash, if the service is still running => crash.

I'm not 100% that the crash is due to Robospice, but I do not use notification manager in my code, and it always crash when leaving the app with service un background.

Here is the full error in logcat :
E/UncaughtException: android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=null pri=-2 contentView=null vibrate=null sound=null defaults=0x0 flags=0x40 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:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions