Closed Asharulislam closed 2 years ago
@Asharulislam has this issue been created in response to https://github.com/ably/ably-flutter/issues/226#issuecomment-1142063300?
@QuintinWillison (#266) comment is when I am using Flutter firebase messaging plugin and ably plugin both simultaneously. Now I have remove the firebase package and using ably for both notification and chatting purpose but my android application got crash in terminated state when I push notification.
@Asharulislam, what flutter the flutter are you using? It looks like an issue with dispatching the call to the proper thread in the SDK.
@davyskiba Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision 18116933e7 (8 months ago) • 2021-10-15 10:46:35 -0700 Engine • revision d3ea636dc5 Tools • Dart 2.14.4
package: ably_flutter: ^1.2.12
@Asharulislam thanks, I'll try to reproduce it on my side
I am not using firebase_messaging package.
2022-06-15 16:34:16.617 26304-26365/com.appiskey.dang.dev E/AndroidRuntime: FATAL EXCEPTION: pool-12-thread-1 Process: com.appiskey.dang.dev, PID: 26304 java.lang.RuntimeException: Methods marked with UiThread must be executed on the main thread. Current thread: pool-12-thread-1 at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:1280) at io.flutter.embedding.engine.FlutterJNI.setPlatformMessageHandler(FlutterJNI.java:854) at io.flutter.embedding.engine.dart.DartExecutor.onAttachedToJNI(DartExecutor.java:87) at io.flutter.embedding.engine.FlutterEngine.(FlutterEngine.java:296)
at io.flutter.embedding.engine.FlutterEngine.(FlutterEngine.java:262)
at io.flutter.embedding.engine.FlutterEngine.(FlutterEngine.java:242)
at io.flutter.embedding.engine.FlutterEngine.(FlutterEngine.java:162)
at io.ably.flutter.plugin.push.ManualFlutterApplicationRunner.(ManualFlutterApplicationRunner.java:52)
at io.ably.flutter.plugin.push.FirebaseMessagingReceiver.sendMessageToFlutterApplication(FirebaseMessagingReceiver.java:68)
at io.ably.flutter.plugin.push.FirebaseMessagingReceiver.lambda$onReceive$0$FirebaseMessagingReceiver(FirebaseMessagingReceiver.java:36)
at io.ably.flutter.plugin.push.-$$Lambda$FirebaseMessagingReceiver$Q7xqX52FAypmyYY-RYC6oZwb4P8.run(Unknown Source:6)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)