When going to the background, the application stops working on devices with Android 12
Exception java.lang.RuntimeException:
at android.app.ActivityThread.handleCreateService (ActivityThread.java:4953)
at android.app.ActivityThread.access$1800 (ActivityThread.java:310)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2300)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loopOnce (Looper.java:226)
at android.os.Looper.loop (Looper.java:313)
at android.app.ActivityThread.main (ActivityThread.java:8663)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1135)
Caused by java.lang.IllegalArgumentException:
at android.app.PendingIntent.checkFlags (PendingIntent.java:382)
at android.app.PendingIntent.getActivityAsUser (PendingIntent.java:465)
at android.app.PendingIntent.getActivity (PendingIntent.java:451)
at android.app.PendingIntent.getActivity (PendingIntent.java:415)
at de.appplant.cordova.plugin.background.ForegroundService.makeNotification (ForegroundService.java:241)
at de.appplant.cordova.plugin.background.ForegroundService.makeNotification (ForegroundService.java:160)
at de.appplant.cordova.plugin.background.ForegroundService.keepAwake (ForegroundService.java:129)
at de.appplant.cordova.plugin.background.ForegroundService.onCreate (ForegroundService.java:97)
at android.app.ActivityThread.handleCreateService (ActivityThread.java:4940)
When going to the background, the application stops working on devices with Android 12
Exception java.lang.RuntimeException: at android.app.ActivityThread.handleCreateService (ActivityThread.java:4953) at android.app.ActivityThread.access$1800 (ActivityThread.java:310) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2300) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loopOnce (Looper.java:226) at android.os.Looper.loop (Looper.java:313) at android.app.ActivityThread.main (ActivityThread.java:8663) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:567) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1135) Caused by java.lang.IllegalArgumentException: at android.app.PendingIntent.checkFlags (PendingIntent.java:382) at android.app.PendingIntent.getActivityAsUser (PendingIntent.java:465) at android.app.PendingIntent.getActivity (PendingIntent.java:451) at android.app.PendingIntent.getActivity (PendingIntent.java:415) at de.appplant.cordova.plugin.background.ForegroundService.makeNotification (ForegroundService.java:241) at de.appplant.cordova.plugin.background.ForegroundService.makeNotification (ForegroundService.java:160) at de.appplant.cordova.plugin.background.ForegroundService.keepAwake (ForegroundService.java:129) at de.appplant.cordova.plugin.background.ForegroundService.onCreate (ForegroundService.java:97) at android.app.ActivityThread.handleCreateService (ActivityThread.java:4940)