Open
Description
Please check the following before submitting a new issue.
- I have searched the existing issues.I have carefully read the documentation and verified I have added the required platform specific configuration.
Please select affected platform(s)
- AndroidiOSWindows
Steps to reproduce
- Add the package to
pubspec.yaml
- Build and launch the app
- Windows shows the "Location in use by" taskbar icon and lists the flutter app
Related issues: #1289
Additional info:
The package is merely included in pubspec.yaml
, but isn't actively included anywhere in the code. No location permissions are actively requested, nor needed. Still, as soon as the app is launched, Windows 11 shows the app as currently using the user's location.
This also happens when the app is packaged for Windows using msix
package (following the official Flutter instructions). In the msix config, location capabilities are not even requested. I'm assuming this package might request these permissions anyway, overriding the capabilities specified in the msix config.
Expected results
- Location is not being used or accessed unless specifically requested
Actual results
- Location shows up as being requested at all times. Maybe it's not being used as all, just wrongly detected, but that should also not happen.
Code sample
Code sample
dependencies:
flutter:
sdk: flutter
permission_handler: ^11.3.1
Screenshots or video
Version
11.3.1
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.22631.4249], locale en-US)
• Flutter version 3.24.3 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (4 weeks ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Users\Chaphasilor\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
• All Android licenses accepted.
[✗] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Visual Studio - develop Windows apps (Visual Studio Build Tools 2022 17.11.4)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
• Visual Studio Build Tools 2022 version 17.11.35312.102
• Windows 10 SDK version 10.0.22621.0
[✓] Android Studio (version 2024.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
[✓] VS Code (version 1.94.0)
• VS Code at C:\Users\Chaphasilor\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.98.0
[✓] Connected device (2 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.4249]
• Edge (web) • edge • web-javascript • Microsoft Edge 129.0.2792.79
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.
Metadata
Metadata
Assignees
Labels
No labels
Activity
leonsavvidi commentedon Oct 10, 2024
Encountering the same issue when building for windows. No permissions were requested, yet windows displays that location is in use. Removing all code connected to permission handler does not help, only helps if you remove
permission_handler: ^11.3.1';
in the pubspec.yamlleonsavvidi commentedon Oct 10, 2024
PermissionHandlerWindowsPlugin::PermissionHandlerWindowsPlugin(){ m_positionChangedRevoker = geolocator.PositionChanged(winrt::auto_revoke, [this](Geolocator const& geolocator, PositionChangedEventArgs e) { }); }
Found the problem, when the cpp permission_handler plugin class is created during app start, it is getting access to the geolocator even before any app requests for permission are being made. (that's why only adding/removing into pubspec mattered, as it fired up during plugin registration) Commenting it out removes the windows notification that the app uses Location data, but most likely breaks the geolocation. This kind of code should be used after the permission is requested, not before even the main app starts.
harshitappscrip commentedon Oct 21, 2024
I'm not using any location-related features in my app, yet my Windows app still accesses location data. I tried to replicate this issue in a fresh project with only the boilerplate code and the permission_handler package added to the pubspec, but I encountered the same problem.
I'm using latest version: 11.3.1
kaciula commentedon Dec 26, 2024
My clients that have installed my app from Microsoft Store get a dialog asking for access to precise location and location history although my app does not use location anywhere and does not explicitly ask for any permissions on Windows.
Do not ask for location on Windows even though no location feature is…
MSOB7YY commentedon Apr 27, 2025
still no official fix? the app shows that its accessing location ALL the time :/
stefan-sherwood commentedon May 5, 2025
In Android this exact problem happened because the Bluetooth permission (android.permission.BLUETOOTH_SCAN) could be used by an app to discover the user's location so requesting Bluetooth would ask the user if they wanted to grant location access. It is highly confusing from the user's standpoint. The solution was to add a permission in the AndroidManifest.xml like this:
Perhaps there is something similar on Windows.
MSOB7YY commentedon May 5, 2025
@stefan-sherwood that's very confusing, idk much about windows but as shown in 32ffba1, the callback for location doesn't call any other code, so im not sure why it was added or if it had any impact