You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had the same problem at Android 8 (API26+). I upgraded my working App from TargetApi 26 to TargetApi 28 (Android 8) and this Plugin didn't work anymore. It always caused a crash as the app started going into Background-Mode.
The Logs showed this error:
--------- beginning of crash 2020-03-28 11:55:12.456 /? E/AndroidRuntime: FATAL EXCEPTION: main Process: 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:1945) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
As it says in the new documentation from Android 8:
Before you can deliver the notification on Android 8.0 and higher, you must register your app's notification channel with the system by passing an instance of NotificationChannel to createNotificationChannel(). So the following code is blocked by a condition on the SDK_INT version
So the crash is caused, because the notification of this plugin has no channel defined. After I found out about this problem, I created a copy of this plugin. I created a Notification Channel and added it to the notification of this plugin. Now it works find, without crashes!
[email protected] getting crashed while start the service
The text was updated successfully, but these errors were encountered: