Baseflow / flutter-permission-handler

Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
https://baseflow.com
MIT License
2.05k stars 860 forks source link

[Bug]: Different behavior in debug and release #1406

Open xOldeVx opened 1 day ago

xOldeVx commented 1 day ago

Please check the following before submitting a new issue.

Please select affected platform(s)

Steps to reproduce

I'm using Android 14 (Galaxy 22 Ultra) and when i'm running await Permission.bluetoothConnect.request().isGranted; in debug it's prompt the Bluetooth permission pop:

image

But in release it's prompt the Location permission pop:

image

I'm using only these permissions in Manifest and it's working good in debug (connection, transfer data etc..)

    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_SCAN"  android:usesPermissionFlags="neverForLocation" />

Expected results

prompt the Bluetooth permission

Actual results

prompt the Location permission

Code sample

Code sample ```dart await Permission.bluetoothConnect.request().isGranted; ```

Screenshots or video

Screenshots or video demonstration [Upload media here]

Version

v11.3.1

Flutter Doctor output

Doctor output ```console [✓] Flutter (Channel stable, 3.24.4, on macOS 14.6.1 23G93 darwin-arm64, locale en-IL) • Flutter version 3.24.4 on channel stable at /Users/myUser/Documents/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 603104015d (3 weeks ago), 2024-10-24 08:01:25 -0700 • Engine revision db49896cf2 • Dart version 3.5.4 • DevTools version 2.37.3 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/myUser/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/myUser/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15C500b • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2024.1) • Android Studio at /Applications/Android Studio.app/Contents • 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-17.0.11b1207.24-11852314) [✓] VS Code (version 1.95.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.100.0 [✓] Connected device (4 available) • SM S908E (mobile) • R5CTA0YHY4F • android-arm64 • Android 14 (API 34) • macOS (desktop) • macos • darwin-arm64 • macOS 14.6.1 23G93 darwin-arm64 • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.6.1 23G93 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 130.0.6723.117 [✓] Network resources • All expected network resources are available. • No issues found! ```
xOldeVx commented 1 day ago

Just added <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> to manifest and it's fix the bug