flutter-permission-handler icon indicating copy to clipboard operation
flutter-permission-handler copied to clipboard

[Bug]:Lock the screen when the address permission is enabled,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)

Open yuqing374 opened this issue 1 year ago • 7 comments

Please check the following before submitting a new issue.

Please select affected platform(s)

  • [ ] Android
  • [X] iOS
  • [ ] Windows

Steps to reproduce

1、Request address permission 2、Lock screen 3、Request address permission

Expected results

The address permission dialog box is displayed

Actual results

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

Code sample
static openStore(
    BuildContext context,
  ) async {
    Permission.location.status.then((value) {
      if (value == PermissionStatus.granted) {
        openStorePage(context, 0);
      } else if (value == PermissionStatus.denied) {
        Permission.location.request().then((value) {
          if (value == PermissionStatus.granted) {
            openStorePage(context, 0);
          } else {
            openStorePage(context, 2);
          }
        });
        AndroidUtil.clearFlagSecure();
      } else if (value == PermissionStatus.permanentlyDenied || value == PermissionStatus.restricted) {
        openStorePage(context, 1);
      } else {
        if (Platform.isAndroid) {
          Permission.location.request().then((value) {
            if (value == PermissionStatus.granted) {
              openStorePage(context, 0);
            } else {
              openStorePage(context, 1);
            }
          });
          AndroidUtil.clearFlagSecure();
        }
      }
    });
  }

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

11.0.1

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.6, on macOS 14.0 23A344 darwin-x64, locale zh-Hans-CN)
    • Flutter version 3.10.6 on channel stable at /Applications/flutter3.10.6
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (6 months ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn


yuqing374 avatar Jan 08 '24 09:01 yuqing374

same same

yanashenyang avatar Mar 25 '24 06:03 yanashenyang

The same issue is happening with android.

Cheng455153666 avatar Apr 01 '24 03:04 Cheng455153666

Any update?

TanLV4 avatar Apr 17 '24 02:04 TanLV4

Any update?

zhanggenlove avatar May 06 '24 09:05 zhanggenlove

getting the same issue in Android and iOS both.

PlatformException(PermissionHandler.PermissionManager, 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).

samarjeetr2001 avatar May 16 '24 11:05 samarjeetr2001