Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android - when calling NativeScreenshot.takeScreenshotImage i got this error #4

Open
ttzein6 opened this issue Oct 27, 2023 · 2 comments

Comments

@ttzein6
Copy link

ttzein6 commented Oct 27, 2023


E/MethodChannel#native_screenshot_ext(16789): Failed to handle method call
E/MethodChannel#native_screenshot_ext(16789): java.lang.ClassCastException: java.util.HashMap cannot be cast to java.util.ArrayList
E/MethodChannel#native_screenshot_ext(16789): 	at jpg.ivan.native_screenshot.NativeScreenshotPlugin.onMethodCall(NativeScreenshotPlugin.java:143)
E/MethodChannel#native_screenshot_ext(16789): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/MethodChannel#native_screenshot_ext(16789): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#native_screenshot_ext(16789): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#native_screenshot_ext(16789): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#native_screenshot_ext(16789): 	at android.os.Handler.handleCallback(Handler.java:942)
E/MethodChannel#native_screenshot_ext(16789): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#native_screenshot_ext(16789): 	at android.os.Looper.loopOnce(Looper.java:226)
E/MethodChannel#native_screenshot_ext(16789): 	at android.os.Looper.loop(Looper.java:313)
E/MethodChannel#native_screenshot_ext(16789): 	at android.app.ActivityThread.main(ActivityThread.java:8741)
E/MethodChannel#native_screenshot_ext(16789): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#native_screenshot_ext(16789): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/MethodChannel#native_screenshot_ext(16789): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
[log] Catched Error : PlatformException(error, java.util.HashMap cannot be cast to java.util.ArrayList, null, java.lang.ClassCastException: java.util.HashMap cannot be cast to java.util.ArrayList
      	at jpg.ivan.native_screenshot.NativeScreenshotPlugin.onMethodCall(NativeScreenshotPlugin.java:143)
      	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
      	at android.os.Handler.handleCallback(Handler.java:942)
      	at android.os.Handler.dispatchMessage(Handler.java:99)
      	at android.os.Looper.loopOnce(Looper.java:226)
      	at android.os.Looper.loop(Looper.java:313)
      	at android.app.ActivityThread.main(ActivityThread.java:8741)
      	at java.lang.reflect.Method.invoke(Native Method)
      	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
      	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
      )


@ttzein6
Copy link
Author

ttzein6 commented Oct 27, 2023

I am using the package like that
Screenshot 2023-10-27 at 4 21 34 PM

@K123Ritesh
Copy link

@ttzein6 is taking screen shot working for > Android 13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants