Open Soheldeveloper opened 7 months ago
Same issue,
When app is going to sleep mode and after wake mode its crashing E/MethodChannel#x-slayer/overlay_channel( 2243): Failed to handle method call E/MethodChannel#x-slayer/overlay_channel( 2243): java.lang.IllegalStateException: Not allowed to start service Intent { flg=0x30000000 cmp=com.qspiders.flutter_project/flutter.overlay.window.flutter_overlay_window.OverlayService (has extras) }: app is in background uid UidRecord{8681324 u0a168 RCVR bg:+36m31s630ms idle change:uncached procs:1 seq(0,0,0)} E/MethodChannel#x-slayer/overlay_channel( 2243): at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1616) E/MethodChannel#x-slayer/overlay_channel( 2243): at android.app.ContextImpl.startService(ContextImpl.java:1571) E/MethodChannel#x-slayer/overlay_channel( 2243): at android.content.ContextWrapper.startService(ContextWrapper.java:669) E/MethodChannel#x-slayer/overlay_channel( 2243): at flutter.overlay.window.flutter_overlay_window.FlutterOverlayWindowPlugin.onMethodCall(FlutterOverlayWindowPlugin.java:110) E/MethodChannel#x-slayer/overlay_channel( 2243): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267) E/MethodChannel#x-slayer/overlay_channel( 2243): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) E/MethodChannel#x-slayer/overlay_channel( 2243): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322) E/MethodChannel#x-slayer/overlay_channel( 2243): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) E/MethodChannel#x-slayer/overlay_channel( 2243): at android.os.Handler.handleCallback(Handler.java:883) E/MethodChannel#x-slayer/overlay_channel( 2243): at android.os.Handler.dispatchMessage(Handler.java:100) E/MethodChannel#x-slayer/overlay_channel( 2243): at android.os.Looper.loop(Looper.java:214) E/MethodChannel#x-slayer/overlay_channel( 2243): at android.app.ActivityThread.main(ActivityThread.java:7356) E/MethodChannel#x-slayer/overlay_channel( 2243): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#x-slayer/overlay_channel( 2243): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491) E/MethodChannel#x-slayer/overlay_channel( 2243): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940)
Same issue:
E/AndroidRuntime(18128): FATAL EXCEPTION: main
E/AndroidRuntime(18128): Process: br.com.neodelivery.driver, PID: 18128
E/AndroidRuntime(18128): java.lang.RuntimeException: Unable to create service flutter.overlay.window.flutter_overlay_window.OverlayService: java.lang.NullPointerException: Attempt to invoke virtual method 'io.flutter.embedding.engine.dart.DartExecutor io.flutter.embedding.engine.FlutterEngine.getDartExecutor()' on a null object reference
E/AndroidRuntime(18128): at android.app.ActivityThread.handleCreateService(ActivityThread.java:4664)
E/AndroidRuntime(18128): at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
E/AndroidRuntime(18128): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2264)
E/AndroidRuntime(18128): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(18128): at android.os.Looper.loopOnce(Looper.java:205)
E/AndroidRuntime(18128): at android.os.Looper.loop(Looper.java:294)
E/AndroidRuntime(18128): at android.app.ActivityThread.main(ActivityThread.java:8177)
E/AndroidRuntime(18128): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18128): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/AndroidRuntime(18128): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
E/AndroidRuntime(18128): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'io.flutter.embedding.engine.dart.DartExecutor io.flutter.embedding.engine.FlutterEngine.getDartExecutor()' on a null object reference
E/AndroidRuntime(18128): at flutter.overlay.window.flutter_overlay_window.OverlayService.
@abneradekz @chinmay4github1987 @Soheldeveloper Any new updates regarding this issue or if anyone solved it?
@youssefm15 no for me
Is there any update regarding this, I have the same Problem
Hi @X-SLAYER ,
Do you have any plan on this to resolve.
Thanks
I want to open Overlay from background when app is in kill state. Specially when firebase ping comes in background. So is is possible in this library or not ?
When I am trying to do this, I face following error.
**E/flutter (30813): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, Not allowed to start service Intent { flg=0x30000000 cmp=my.package.name/flutter.overlay.window.flutter_overlay_window.OverlayService (has extras) }: app is in background uid UidRecord{25fa346 u0a887 RCVR idle procs:1 seq(0,0,0)}, null, java.lang.IllegalStateException: Not allowed to start service Intent { flg=0x30000000 cmp=com.vivacom.mhealth/flutter.overlay.window.flutter_overlay_window.OverlayService (has extras) }: app is in background uid UidRecord{25fa346 u0a887 RCVR idle procs:1 seq(0,0,0)}
E/flutter (30813): at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1536) E/flutter (30813): at android.app.ContextImpl.startService(ContextImpl.java:1492) E/flutter (30813): at android.content.ContextWrapper.startService(ContextWrapper.java:650) E/flutter (30813): at flutter.overlay.window.flutter_overlay_window.FlutterOverlayWindowPlugin.onMethodCall(FlutterOverlayWi E/flutter (30813): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258) E/flutter (30813): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) E/flutter (30813): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-en E/flutter (30813): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) E/flutter (30813): at android.os.Handler.handleCallback(Handler.java:790) E/flutter (30813): at android.os.Handler.dispatchMessage(Handler.java:99) E/flutter (30813): at android.os.Looper.loop(Looper.java:164) E/flutter (30813): at android.app.ActivityThread.main(ActivityThread.java:6626)
E/flutter (30813): at java.lang.reflect.Method.invoke(Native Method) E/flutter (30813): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) E/flutter (30813): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811) E/flutter (30813): ) E/flutter (30813): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652) E/flutter (30813): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310) E/flutter (30813):
E/flutter (30813): #2 FlutterOverlayWindow.showOverlay (package:flutter_overlay_window/src/overlay_window.dart:54)
E/flutter (30813):
E/flutter (30813): #3 _showOverLay (package:caafiya/main_flavor/main_shaafi.dart:84)
E/flutter (30813):
E/flutter (30813):**
Following is my code for opening overlay in main.dart