Android - requestPermission not asking for permission
See original GitHub issueDescribe the bug
When calling location.requestPermission(), Android does not ask for permission
Expected behavior A popup should appears, asking for permission
Tested on:
- OnePlus 6 (Android 9)
- Pixel XL Emulator (API 28)
Additional logs
Exception has occurred. PlatformException (PlatformException(PERMISSION_DENIED_NEVER_ASK, Location permission denied forever- please open app settings, null))
I also created this thread on Stackoverflow.
Future<LocationData> _getLocation() async {
LocationData currentLocation;
var test = await location.requestPermission();
try {
currentLocation = await location.getLocation();
} catch (e) {
currentLocation = null;
}
return currentLocation;
}
When I go to the app Settings on my OP6, the permissions is greyed out, saying “no permissions requested”
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
ActivityCompat.requestPermissions not showing dialog box
I had a need to request permission for WRITE_EXTERNAL_STORAGE but was not ... Android) the Permission dialog includes a check box labeled "Never...
Read more >Request app permissions - Android Developers
Overview · Build a calling app · Prevent caller ID spoofing · Telephony IDs. Wi-Fi. Request permission to access nearby Wi-Fi devices ...
Read more >Android: Request Permissions do not show dialog boxes
// No explanation needed, we can request the permission. ActivityCompat.requestPermissions( thisActivity, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE),
Read more >How to Request Permissions in Android Application?
Android provides several methods that can be used to request permission, such as requestPermissions(). Syntax: ActivityCompat.requestPermissions ...
Read more >Android Runtime Permissions Example - DigitalOcean
Requesting Android Runtime Permissions. The method requestPermissions(String[] permissions, int requestCode); is a public method that is ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Okay it seems setup correctly. That’s strange because when you add the plugin to your app, Flutter is supposed to automatically add the requested permission in your
AndroidManifest.xmlso it should appear in your app’s settings. Can you try to do aflutter cleanto see if this is not a build problem ?omg, you are a genius, I got the popup !
Thank you !