-
-
Notifications
You must be signed in to change notification settings - Fork 874
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
A request for permissions is already running - How stop request? - 5.0.0+hotfix.3 #245
Comments
I'm also having this same problem. Is there a certain way to determine if a permission request is already running? If there is no such feature and it makes sense to you, I can try to add it. |
I expect the following: PS Sorry for my English :-) |
Update to hotfix3. E/flutter ( 7630): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] 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) |
Hi @KirillNNRUS, it is a bit hard to judge what really is going on since the code sample is a bit limited. I am trying to reproduce it but the example app doesn't show this behaviour, maybe it is helpful for you to have a look there: https://github.com/Baseflow/flutter-permission-handler/tree/develop/permission_handler/example If you could supply a sample to reproduce the problem I would be more then happy to have a more detailed look. |
@mvanbeusekom Please check your email :-) |
Upgrade Flutter to: Problem is still here :-( |
Same problem here. Any solutions? |
I haven't solution. All hope in Maurits, which I allowed access to my application :-) |
I can indeed reproduce the issue in the code base of @KirillNNRUS but I was not yet able to find a solution unfortunately. In the Android code I do the following:
This is the part where we request the permissions on the native side. As you can see I set the Strange thing is that I cannot reproduce it with the example app or a new app if I create it. But somehow it does show up in @KirillNNRUS (and I guess others) applications. Maybe somebody has an idea that could put me on the right track? |
I have the same problem and only workaround that worked for me is checking if permission is already granted before requesting it.
I hope it works for you also until author takes a look at this problem. |
@mvanbeusekom - Are your create new app with Kotlin support? I will try soon create new project, and "copy" "Dart" files, and "Android properties" files to him. And I will write whether it helped or not. |
@KirillNNRUS yes I noticed you used Kotlin in your App, so I made sure I also created a new App using Kotlin. I am still not sure what is going on, I took the implementation that I posted above from one of the Flutter camera plugin (more specifically: https://github.com/flutter/plugins/blob/3af2bfa201744f8c4949c874bfebd8a4070e2636/packages/camera/android/src/main/java/io/flutter/plugins/camera/CameraPermissions.java#L25). Maybe someone can compare the |
@mvanbeusekom Here is the result: I'll try to compare what I can. And write what I found. PS Many thanks to all for the help and support, and especially Maurits :-) |
I have been going over this and turns out you need to migrate your app if you have created it using the pre-1.12 flutter templates. Here is a guide to do so: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects (or you could of course copy your code over to a newly generated App ;) ) I will also add this to the README.md for further references. Thanks for thinking with me everybody! |
I'm using permission_handler: 5.1.0+2, Android v2 embedding but still getting this error via Crashlytics.
code
doctor
|
I ran into the same issue. Turn out, the reason is I override this method without calling super()
in MainActivity.java. Remove this method do the work. |
Still in issue in flutter 2.10 |
For now this is what I have done: while (true) { |
Up to permission_handler 5.0.0+hotfix.2. Problem is still here.
Flutter 1.12.13+hotfix.8 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 0b8abb4724 (7 weeks ago) • 2020-02-11 11:44:36 -0800
Engine • revision e1e6ced81d
Tools • Dart 2.7.0
I have a simple app, where i ask permission storage.
1 - Ask a permission, and say "no" (run Future _attachFile())
2- When ask again (run Future _attachFile()) i have a error
E/flutter (11118): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] 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) - in log
And nothing happens in mobile
What i'am doing wrong?
Or in new version need work only with status? Like this:
PS Sorry for my English :-)
The text was updated successfully, but these errors were encountered: