serviceMain stops when the device screen is off
serviceMain does not close but stops when the device screen is off, once you turn on the screen, the service continues to run without problems. I need the service to keep running when the screen is off. How can I achieve this?
Thank you for reporting this @hansel93. Can you specify what version of Android and Flutter you're using
[√] Flutter (Channel stable, 2.0.5, on Microsoft Windows [Versión 10.0.19043.1706], locale es-ES) • Flutter version 2.0.5 at C:\src\flutter • Framework revision adc687823a (1 year, 4 months ago), 2021-04-16 09:40:20 -0700 • Engine revision b09f014e96 • Dart version 2.12.3
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1) • Android SDK at D:\Hansel\Android\AndroidSDK • Platform android-30, build-tools 30.0.1 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted.
[√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 4.1.0) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.70.2) • VS Code at C:\Users\hansel\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.46.0
[√] Connected device (3 available) • 2109119DG (mobile) • 4ca919f6 • android-arm64 • Android 11 (API 30) • Chrome (web) • chrome • web-javascript • Google Chrome 104.0.5112.101 • Edge (web) • edge • web-javascript • Microsoft Edge 89.0.774.68