Skip to content

on android platform if i select denied and request permission again , it return exception message "request for permissions is already running" #950

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

Closed
Etermally opened this issue Nov 2, 2022 · 8 comments
Labels
P2 Important issues not at the top of the work list. platform: android Issue is related to the Android platform. status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. status: needs more info We need more information before we can continue work on this issue. type: bug Something isn't working

Comments

@Etermally
Copy link

💬 Questions and Help

SOS!!! HELP!!! MOGUL!!!
截屏2022-11-02 14 43 09

on android platform if i select denied and request permission again , it return exception message "request for permissions is already running"

E/flutter (24097): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: 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)
E/flutter (24097): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter (24097): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
E/flutter (24097):
E/flutter (24097): #2 MethodChannelPermissionHandler.requestPermissions (package:permission_handler_platform_interface/src/method_channel/method_channel_permission_handler.dart:71:9)
E/flutter (24097):
E/flutter (24097): #3 _TEstPermissionPageState._selectContact (package:digital_storage_app/mine/controller/test_test_permission_page.dart:116:50)
E/flutter (24097):

@Etermally
Copy link
Author

How to solve this problem? Very worried! Thanks for your advice!

@ubitechparth
Copy link

ubitechparth commented Nov 5, 2022

when I am allow all the permissions than second time I am hit location function this errors comes in console
how to solve it multiple permission allow in one time .
E/flutter (20374): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 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)
E/flutter (20374): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
E/flutter (20374): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296:18)
E/flutter (20374):
E/flutter (20374): #2 MethodChannelPermissionHandler.requestPermissions (package:permission_handler_platform_interface/src/method_channel/method_channel_permission_handler.dart:71:9)
E/flutter (20374):
E/flutter (20374): #3 LocationController.checkPermission (package:ubiattendance/core/widget/location/controller/LocationController.dart:115:53)
E/flutter (20374):

@E-MRE
Copy link

E-MRE commented Nov 10, 2022

same problem. I try to request microphone request. I allow it but package doesn't respond to me.

@samyakbardiya
Copy link

I am having this same issue.

what I trying to do is:

    PermissionStatus status = await Permission.locationWhenInUse.status;

    if (status.isGranted) {
      // location permission is GRANTED
      print('===> permission GRANTED');
    } else if (status.isDenied) {
      // location permission is NOT GRANTED
      await Permission.locationWhenInUse.request();
    } else if (status.isPermanentlyDenied) {
      // location permission is PERMANENTLY DENIED
      openAppSettings();
    }

but it always throws exception on Permission.locationWhenInUse.request() and doesn't request for the permission also.

I am guessing that .request() is having some issues.

I tested an Android 13 & Android 11. same thing on both devices.

@steph-laporte
Copy link

Same problem with android and camera permission. First time requesting permission the popup is displayed. Then if we choose denied when we try later to request again the permission the popup is not displayed and the exception occurs. The problem doesn't occurs if the first time the popup is displayed we do not choose any option but have tapped outside the popup on the overlay.
Unhandled Exception: PlatformException(PermissionHandler.PermissionManager, A request for permissions is already running, please wait for it to finish before doing another request

@sjoerdlmkns
Copy link

We are experiencing the same problem on some Android devices. Our code looks like this:

Future<void> _showCameraPermissionDialog(BuildContext context) => showDialog<void>(
      context: context,
      builder: (context) => CameraPermissionDialog(),
    );


Future<bool> handleCameraPermission(BuildContext context) async {
  final cameraPermissionStatus = await Permission.camera.request();


  if (cameraPermissionStatus.isGranted) {
    return true;
  } else if (cameraPermissionStatus.isPermanentlyDenied) {
    await _showCameraPermissionDialog(context);
  }


  return false;
}

@JeroenWeener JeroenWeener added platform: android Issue is related to the Android platform. type: bug Something isn't working P2 Important issues not at the top of the work list. labels Aug 17, 2023
@JeroenWeener
Copy link
Contributor

Hi all!

I'd like to know if this is still an issue on the latest version of the plugin (11.0.1).

I have tested the code of @sjoerdlmkns in an emulator running Android 14 (API 34), but did not encounter any issue.

You can find my example app in this gist: https://gist.github.com/JeroenWeener/461f1b42c1ccff9fb97764fff3b1f890

@JeroenWeener JeroenWeener added the status: needs more info We need more information before we can continue work on this issue. label Oct 16, 2023
@github-actions
Copy link

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.

@github-actions github-actions bot added the status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. label Oct 30, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2023
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: android Issue is related to the Android platform. status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. status: needs more info We need more information before we can continue work on this issue. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants