brilliantlabsAR / noa-flutter

The Noa app for iOS and Android
Other
38 stars 23 forks source link

[bug] Missing android.permission.BLUETOOTH #148

Open josuah opened 2 months ago

josuah commented 2 months ago

As reported on https://discord.com/channels/963222352534048818/1270235803708166184:

If I close out the "Bring your device closer" and go into the logs this is what I get in the Bluetooth

WARNING - Couldn't obtain Bluetooth permission. PlatformException(androidException, java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10627 nor current process has android.permission.BLUETOOTH., java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10627 nor current process has android.permission.BLUETOOTH.
    at android.os.Parcel.createException(Parcel.java:2088)
    at android.os.Parcel.readException(Parcel.java:2056)
    at android.os.Parcel.readException(Parcel.java:2004)
    at android.bluetooth.IBluetooth$Stub$Proxy.getState(IBluetooth.java:3176)
    at android.bluetooth.BluetoothAdapter.getBleState(BluetoothAdapter.java:1909)
    at android.bluetooth.BluetoothAdapter.getBleEnabledArray(BluetoothAdapter.java:1392)
    at android.bluetooth.BluetoothAdapter.isBleApiAvailable(BluetoothAdapter.java:1500)
    at android.bluetooth.BluetoothAdapter.getBluetoothLeScanner(BluetoothAdapter.java:1242)
    at g3.o.E(Unknown Source:2623)
    at c4.k$a.a(Unknown Source:17)
    at r3.c.l(Unknown Source:18)
    at r3.c.m(Unknown Source:41)
    at r3.c.i(Unknown Source:0)
    at r3.b.run(Unknown Source:12)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:8167)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
, null)
INFO - Starting to scan for devices
INFO - Stopping scan for devices

Went into the "about this apps" settings and looked at the permissions. The only option there to allow or disallow is for Location. It always shows up in Bluetooth settings as an available device.

Samsung S9+ Android 10

One someone else's phone, it asks for Location permissions and Bluetooth permissions. It also had a different landing page where you can sign in with google instead of typing in your email.

What was attempted:

CitizenOneX commented 2 months ago

The Flutter Blue Plus recommended AndroidManifest.xml settings to appear to be slightly different to what's currently in noa-flutter's manifest: FBP reference at least for Android versions <= 11. (E.g. maxSdkVersion attributes, absence of BLUETOOTH_ADMIN entirely etc.)

I haven't investigated how it fails due to these differences, I just always copy that whole block of permissions into the Android Manifest as-is when adding FBP to a project.

siliconwitch commented 2 months ago

Will update these permissions 👍

alchemystack commented 1 month ago

Doesn't ask for Bluetooth permission on Android 8.1.0 so I can't use it :(

WARNING - Couldn't obtain Bluetooth permission. PlatformException(androidException, java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10141 nor current process has android.permission.BLUETOOTH., java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10141 nor current process has android.permission.BLUETOOTH. at android.os.Parcel.readException(Parcel.java:2013) at android.os.Parcel.readException(Parcel.java:1959) at android.bluetooth.IBluetooth$Stub$Proxy.getState(IBluetooth.java:908) at android.bluetooth.BluetoothAdapter.getLeState(BluetoothAdapter.java:892) at android.bluetooth.BluetoothAdapter.getLeAccess(BluetoothAdapter.java:905) at android.bluetooth.BluetoothAdapter.getBluetoothLeScanner(BluetoothAdapter.java:688) at b3.p.E(Unknown Source:2623) at s3.k$a.a(Unknown Source:17) at h3.c.l(Unknown Source:18) at h3.c.m(Unknown Source:41) at h3.c.i(Unknown Source:0) at h3.b.run(Unknown Source:12) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6548) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:445) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857) , null) INFO - Starting to scan for devices INFO - Stopping scan for devices