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

Requires a foreground activity, #6

Open
thefdisk opened this issue Aug 19, 2023 · 2 comments
Open

Requires a foreground activity, #6

thefdisk opened this issue Aug 19, 2023 · 2 comments

Comments

@thefdisk
Copy link

When I use this plugin and https://pub.dev/packages/presentation_displays and call showPresentation. The wakelock show log like this :

E/flutter ( 9659): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(NoActivityException, dev.fluttercommunity.plus.wakelock.NoActivityException: wakelock requires a foreground activity, Cause: null, Stacktrace: dev.fluttercommunity.plus.wakelock.NoActivityException: wakelock requires a foreground activity E/flutter ( 9659): at dev.fluttercommunity.plus.wakelock.Wakelock.toggle(Wakelock.kt:17) E/flutter ( 9659): at dev.fluttercommunity.plus.wakelock.WakelockPlusPlugin.toggle(WakelockPlusPlugin.kt:42) E/flutter ( 9659): at WakelockPlusApi$Companion.setUp$lambda$1$lambda$0(Messages.g.kt:143) E/flutter ( 9659): at WakelockPlusApi$Companion.$r8$lambda$V3Ef3eoUCWaUg6-SG5-vgDNZXN8(Unknown Source:0) E/flutter ( 9659): at WakelockPlusApi$Companion$$ExternalSyntheticLambda0.onMessage(Unknown Source:2) E/flutter ( 9659): at io.flutter.plugin.common.BasicMessageChannel$IncomingMessageHandler.onMessage(BasicMessageChannel.java:217) E/flutter ( 9659): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) E/flutter ( 9659): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322) E/flutter ( 9659): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) E/flutter ( 9659): at android.os.Handler.handleCallback(Handler.java:938) E/flutter ( 9659): at android.os.Handler.dispatchMessage(Handler.java:99) E/flutter ( 9659): at android.os.Looper.loop(Looper.java:223) E/flutter ( 9659): at android.app.ActivityThread.main(ActivityThread.java:7656) E/flutter ( 9659): at java.lang.reflect.Method.invoke(Native Method) E/flutter ( 9659): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) E/flutter ( 9659): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) E/flutter ( 9659): , null) E/flutter ( 9659): #0 WakelockPlusApi.toggle (package:wakelock_plus_platform_interface/messages.g.dart:105:7) E/flutter ( 9659): <asynchronous suspension> E/flutter ( 9659): #1 MethodChannelWakelockPlus.toggle (package:wakelock_plus_platform_interface/src/method_channel_wakelock_plus.dart:20:5) E/flutter ( 9659): <asynchronous suspension> E/flutter ( 9659):

flutter doctors :

Doctor summary (to see all details, run flutter doctor -v): [!] Flutter (Channel stable, 3.10.6, on macOS 13.5 22G74 darwin-arm64, locale en-ID) ! Warning: dart` on your path resolves to
/opt/homebrew/Cellar/dart/3.0.6/libexec/bin/dart, which is not inside your
current Flutter SDK checkout at /Users/dwi/Development/flutter. Consider
adding /Users/dwi/Development/flutter/bin to the front of your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.81.1)
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 1 category.`

@hit-flutter
Copy link

Any update on this?

@sunjiaming
Copy link

sunjiaming commented Jan 25, 2024

Follow up, I used this plugin to appear https://github.com/X-SLAYER/flutter_overlay_window

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

3 participants