Android App terminated 1 minute after display timeout
When location request permissions dialog is displayed, using "only this time", the application is terminated 1 minute after display timeout. If permission dialog is not displayed, because you previously answered "While using the app", then this does NOT happen. So, basically every time you turn your phone on with the app in the foreground it is restarting the application!
Android 11 Pixel 3 XL and Emulator
Set Display timeout Turn off developer "Stay Awake"
test_geolocator sample project
flutter doctor -v
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19043.1110], locale en-US) • Flutter version 2.2.3 at C:\projects\flutter • Framework revision f4abaa0735 (6 weeks ago), 2021-07-01 12:46:11 -0700 • Engine revision 241c87ad80 • Dart version 2.13.4[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\matt\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
• All Android licenses accepted.
[√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Android Studio • 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 • android-studio-dir = C:\Program Files\Android\Android Studio • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
[√] VS Code (version 1.59.0) • VS Code at C:\Users\matt\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.25.0
[√] Connected device (3 available) • sdk gphone x86 64 arm64 (mobile) • emulator-5554 • android-x64 • Android 11 (API 30) (emulator) • Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.131 • Edge (web) • edge • web-javascript • Microsoft Edge 92.0.902.67
• No issues found!
Hi @MattyBoy4444,
I am looking into this issue but it is not quite clear how to reproduce it. Can you confirm the following reproduction steps are correct:
- Request permissions using the
await Geolocator.requestPermission()method; - When the permission dialog is shown select "only this time";
- Wait for one minute and notice the App is terminated.
Or do I understand it wrong?
That looks correct except wait for the phone display to turn off. Then wait one minute.
I am closing this issue as there has been no activity in about two years. If you are encountering this issue on the latest version of the geolocator plugin, feel free to open a new issue, linking this issue.