Baseflow / Baseflow/flutter-permission-handler

[Bug]: Error when reopening app with non-standard launchMode and requesting permissions again on Android

Open
#1,426 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
2.2k
Forks
970
Avg merge
14h 22m
Merged PRs (30d)
2

Description

### Please check the following before submitting a new issue.

- [X] I have searched the [existing issues](https://github.com/baseflow/flutter-permission-handler/issues).
- [X] I have carefully [read the documentation](https://github.com/Baseflow/flutter-permission-handler/blob/main/permission_handler/README.md) and verified I have added the required platform specific configuration.

### Please select affected platform(s)

- [X] Android
- [ ] iOS
- [ ] Windows

### Steps to reproduce

1. Set launchMode in the AndroidManifest to a value other than standard.
2. Launch the application.
3. Request permissions.
4. Minimize the application.
5. Reopen the application using the app icon.
6. Request permissions again.

### Expected results

A new system dialog requesting permissions is displayed.

### Actual results

Error:

`PlatformException(ERROR_ALREADY_REQUESTING_PERMISSIONS, A request for permissions is already running, please wait for it to finish before doing another request (note that you can request multiple permissions at the same time)., null, null)`

### Code sample

Permission.locationWhenInUse.request();

### Screenshots or video

_No response_

### Version

11.3.1

### Flutter Doctor output

[✓] Flutter (Channel stable, 3.27.2, on macOS 15.1 24B2082 darwin-arm64)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] Connected device (5 available)
[✓] Network resources

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.