1

I am using more than 2 services in my application , i applied different solutions but they didn't work, app is kill on version after creating a case.

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.abca, PID: 7454
    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=0x42 color=0x00000000 groupKey=net.gotev vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1879)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7091)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
Ray
  • 1,539
  • 1
  • 14
  • 27
  • Welcome to Stack Overflow. Your question should have your effort to solve the task. Here you post abstract question which people will likely delete rather answer. Code is good, environment, screenshots, error codes if any. I would recommend you to check SO's [official How to Ask article](https://stackoverflow.com/help/how-to-ask). – Aleksey Potapov Jan 09 '20 at 08:31
  • 1
    Not all `NotificationChannels` can be used for foreground services. The channel's priority may be too low, for instance. – greeble31 Jan 09 '20 at 15:07

1 Answers1

1

try starting service using startForegroundService() instead of startService()

Saurabh Dhage
  • 1,478
  • 5
  • 17
  • 31