Closed arnavvaryani closed 3 years ago
I am not able to replicate the error, are you using the example app from the master branch?
https://github.com/cph-cachet/flutter-plugins/tree/master/packages/notifications
Yes
I managed to replicate the error on an old android device, will keep you updated.
Ok great thanks
Solved in version 1.0.2+1
Remember to specify the plugin name in the title!
Device / Emulator and OS
Please complete the following information for each phone and/or emulator you're experiencing this bug on:
Describe the bug
[38;5;248mLaunching lib/main.dart on Redmi 8A in debug mode...[39;49m lib/main.dart ✓ Built build/app/outputs/flutter-apk/app-debug.apk. Connecting to VM Service at ws://127.0.0.1:57332/gDULpI2sbpE=/ws E/EventChannel#notifications.eventChannel(23247): Failed to open event stream E/EventChannel#notifications.eventChannel(23247): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? E/EventChannel#notifications.eventChannel(23247): at android.app.ContextImpl.startActivity(ContextImpl.java:962) E/EventChannel#notifications.eventChannel(23247): at android.app.ContextImpl.startActivity(ContextImpl.java:938) E/EventChannel#notifications.eventChannel(23247): at android.content.ContextWrapper.startActivity(ContextWrapper.java:393) E/EventChannel#notifications.eventChannel(23247): at dk.cachet.notifications.NotificationsPlugin.onListen(NotificationsPlugin.kt:46) E/EventChannel#notifications.eventChannel(23247): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:188) E/EventChannel#notifications.eventChannel(23247): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:167) E/EventChannel#notifications.eventChannel(23247): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/EventChannel#notifications.eventChannel(23247): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692) E/EventChannel#notifications.eventChannel(23247): at android.os.MessageQueue.nativePollOnce(Native Method) E/EventChannel#notifications.eventChannel(23247): at android.os.MessageQueue.next(MessageQueue.java:336) E/EventChannel#notifications.eventChannel(23247): at android.os.Looper.loop(Looper.java:178) E/EventChannel#notifications.eventChannel(23247): at android.app.ActivityThread.main(ActivityThread.java:7520) E/EventChannel#notifications.eventChannel(23247): at java.lang.reflect.Method.invoke(Native Method) E/EventChannel#notifications.eventChannel(23247): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) E/EventChannel#notifications.eventChannel(23247): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) I/cations_exampl(23247): ProcessProfilingInfo new_methods=476 is saved saved_to_disk=1 resolve_classes_delay=8000
[38;5;248m════════ Exception caught by services library ══════════════════════════════════[39;49m [38;5;244mThe following PlatformException was thrown while activating platform stream on channel notifications.eventChannel:[39;49m PlatformException(error, Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?, null, null)
[38;5;244mWhen the exception was thrown, this was the stack[39;49m [38;5;244m#0 StandardMethodCodec.decodeEnvelope[39;49m package:flutter/…/services/message_codecs.dart [38;5;244m#1 MethodChannel._invokeMethod[39;49m package:flutter/…/services/platform_channel.dart [38;5;244m[39;49m
[38;5;244m#2 MethodChannel.invokeMethod[39;49m
package:flutter/…/services/platform_channel.dart
[38;5;244m#3 EventChannel.receiveBroadcastStream.[39;49m
package:flutter/…/services/platform_channel.dart
[38;5;244m...[39;49m
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m
To Reproduce
The repo doesn't work in the example repo itself, run the example repo.
Flutter doctor
Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 1.22.1, on macOS 11.0 20A5395g, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1) [!] Android Studio (version 4.1) ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. [✓] VS Code (version 1.50.1) [!] Connected device
! Doctor found issues in 2 categories.