Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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) #1261

Open
3 of 5 tasks
yuqing374 opened this issue Jan 8, 2024 · 5 comments
Assignees
Labels
P2 Important issues not at the top of the work list. platform: ios Issue is related to the iOS platform refactor Issues marked with refactor should be considered when refactoring the plugin. type: bug Something isn't working

Comments

@yuqing374
Copy link

yuqing374 commented Jan 8, 2024

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • 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

@mvanbeusekom mvanbeusekom self-assigned this Feb 5, 2024
@mvanbeusekom mvanbeusekom added platform: ios Issue is related to the iOS platform P2 Important issues not at the top of the work list. refactor Issues marked with refactor should be considered when refactoring the plugin. type: bug Something isn't working labels Mar 18, 2024
@yanashenyang

This comment has been minimized.

@Cheng455153666
Copy link

Cheng455153666 commented Apr 1, 2024

The same issue is happening with android.

@TanLV4
Copy link

TanLV4 commented Apr 17, 2024

Any update?

1 similar comment
@zhanggenlove
Copy link

Any update?

@samarjeetr2001
Copy link

samarjeetr2001 commented May 16, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Important issues not at the top of the work list. platform: ios Issue is related to the iOS platform refactor Issues marked with refactor should be considered when refactoring the plugin. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants