flutter-permission-handler
flutter-permission-handler copied to clipboard
await Permission.locationWhenInUse.request() never returns (Android API 28)
🐛 Bug Report
await Permission.locationWhenInUse.request() doesn't show anything (and never returns) - Android API 28
Expected behavior
Show the user a notification, and return with the correct status
Reproduction steps
Call await Permission.locationWhenInUse.request() on an Android API 28. See https://youtube.com/shorts/j60CfVZDsyE?feature=share This is probably the same bug as https://github.com/Baseflow/flutter-geolocator/issues/1112
Configuration
Version: 10.0.0
Platform:
- [ ] :iphone: iOS
- [X] :robot: Android
Hi @yoniker,
I tried to reproduce the issue on an Android API28 Emulator without success (see screenshot).
Screenshot
I noticed in your youtube video that the permission did get asked, once you got in the open apps overview screen and returned to the app. I tried to reproduce it using the standard Flutter counter app when you run flutter create to ask for the permission as shown in the screenshot. This worked without any problems.
Can you send me a snippet of your code, on how and when you ask for the permission?
Also, have you tried printing the status of the permission after the request()? did it show anything, or return a PermissionStatus.denied or anything?
you can do so by writing the writing the next lines:
final ps = await Permission.locationWhenInUse.request();
print(ps);
Let me know the outcome so I can help you further!
So:
- I did try a print statement after request() and it doesn't print anything (the await command never returns).
- I've tried to reproduce the bug with the default standard app, and it doesn't reproduce(!). In the next few days I will try to produce a minimal code which contains this bug.
In the mean time, if you have advice regarding how I should debug it,that would be great. From what I can see, some call to Android platform never returns.
Hi @yoniker, did you get around to creating a minimal code reproduction? I am interested to find out what is (was?) causing your issue.
Without additional information, we are unfortunately not able to resolve this issue. Therefore, we reluctantly closed this issue for now. If you run into this issue later, feel free to file a new issue with a reference to this issue. Add a description of detailed steps to reproduce, expected and current behaviour, logs and the output of 'flutter doctor -v'. Thanks for your contribution.