-
Notifications
You must be signed in to change notification settings - Fork 609
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
Getting strange ACCESS_FINE_LOCATION denial on Android 12, targeting API 31 #947
Comments
Hi @QuentinFarizon ... it sounds like you've root-caused it correctly there! That's a bit unideal. As a quick test, can you try asking for the It does sound like the Sony Android 12 variant there is non-compliant with Android (as you've already noted) |
This plugin is breaking my Android app. If I don't use this plugin then my @capacitor/geolocation works fine. With this plugin installed my ACCESS_FINE_LOCATION / ACCESS_COARSE_LOCATION issues arise. I can't use this plugin right now. |
Something like this may fix for Android 31/32
|
hi @tigohenryschultz , it sounds like you're hitting #932 The fix here is to switch to the slim variant of this plugin, and manually control those permissions yourself, as per #932 (comment) If that doesn't work, please feel free to raise a new issue. |
Okay I will try that on Monday for now I built my app on a fork with my changes: https://github.com/tigohenryschultz/cordova-plugin-ble-central |
The specific issue you're facing there @tigohenryschultz is that this plugin now specifies a maxSdk version for coarse & fine location, which messes up Cordova's somewhat naive XML merge logic. What your workaround there is doing is simply removing one of the offending permission entries... but it's unfortunately non-deterministic in my experience, so was not suitable to build into the plugin itself 😩 . The only solution in the end is to remove those permission entries completely, as that is the only way to ensure no conflicts with other plugins. |
I am on the latest version of this plugin (1.6.1-cli) and latest cordova-android (11.0.0), so targeting API 31
On some devices (including my personal phone, a Sony Xperia 1 II on Android 12), scanning doesn't work at all. It pormpts for permissions (I even use cordova.plugins.diagnostic to premptively prompt them), but scanning returns no results.
I have tried looking at logcat for some ideas, and I see a strange log about permissions :
BluetoothUtils: Permission denial: Need ACCESS_FINE_LOCATION permission to get scan results
From my understanding, on a Android 12 phone targeting API 31, this permission should not be needed at all.
The text was updated successfully, but these errors were encountered: