dotintent / react-native-ble-plx

React Native BLE library
Apache License 2.0
2.94k stars 492 forks source link

🐛 BLE Scanner Device not found on Android 13 #1156

Closed C0zmaCatalin closed 5 months ago

C0zmaCatalin commented 5 months ago

Prerequisites

Expected Behavior

I used the example code from library to test a BLE Scanner Device ( NETUM R2L, 2D Ring Barcode Scanner). The problem it's that the device it's found on Android 9, but on Android 13 it's not there. I tested with other app from google play https://play.google.com/store/apps/details?id=com.macdom.ble.blescanner&hl=en&gl=US, and the device it's found there.

Screenshot 2023-12-16 at 13 39 52

Current Behavior

The device it's found on Android 9, but not on Android 13

Library version

11.0.6

Device

Samsung Galaxy Note 8 (Android 9), Google Pixel 6 (Android 13), Netum R2L 2D Ring Barcode Scanner

Environment info

info Fetching system and libraries information...
System:
  OS: macOS 13.5
  CPU: (8) arm64 Apple M2
  Memory: 88.30 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.10.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 10.2.3
    path: /usr/local/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.14.3
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11076708
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.0
    wanted: 0.73.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to reproduce

I just opened the app on both platforms, and the device it's not found on android 13

Formatted code sample or link to a repository

It's the code from the example folder.

Relevant log output

I can see something in the Android Studio console for Android 13, I don't know why it's skipping it:

h         V  Skipping data matching denylist: ScanRecord [mAdvertiseFlags=6, mServiceUuids=[0000fff0-0000-1000-8000-00805f9b34fb], mServiceSolicitationUuids=[], mManufacturerSpecificData={76=[2, 21, -3, -91, 6, -109, -92, -30, 79, -79, -81, -49, -58, -21, 7, 100, 120, 37, 39, 81, 101, -63, -58]}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=RT barcode scanner]
2023-12-16 13:34:20.111  2382-2690  BtGatt.GattService      com.google.android.bluetooth         I  Skipping client for location deny list
2023-12-16 13:34:20.111  2382-2690  BtGatt.GattService      com.google.android.bluetooth         V  Skipping data matching denylist: ScanRecord [mAdvertiseFlags=6, mServiceUuids=[0000fff0-0000-1000-8000-00805f9b34fb], mServiceSolicitationUuids=[], mManufacturerSpecificData={76=[2, 21, -3, -91, 6, -109, -92, -30, 79, -79, -81, -49, -58, -21, 7, 100, 120, 37, 39, 81, 101, -63, -58]}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=RT barcode scanner]
2023-12-16 13:34:20.111  2382-2690  BtGatt.GattService      com.google.android.bluetooth         I  Skipping client for location deny list
2023-12-16 13:34:20.111  2382-2690  BtGatt.GattService      com.google.android.bluetooth         V  Skipping data matching denylist: ScanRecord [mAdvertiseFlags=6, mServiceUuids=[0000fff0-0000-1000-8000-00805f9b34fb], mServiceSolicitationUuids=[], mManufacturerSpecificData={76=[2, 21, -3, -91, 6, -109, -92, -30, 79, -79, -81, -49, -58, -21, 7, 100, 120, 37, 39, 81, 101, -63, -58]}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=RT barcode scanner]
2023-12-16 13:34:20.111  2382-2690  BtGatt.GattService      com.google.android.bluetooth         I  Skipping client for location deny list
2023-12-16 13:34:20.111  2382-2690  BtGatt.GattService      com.google.android.bluetooth         V  Skipping data matching denylist: ScanRecord [mAdvertiseFlags=6, mServiceUuids=[0000fff0-0000-1000-8000-00805f9b34fb], mServiceSolicitationUuids=[], mManufacturerSpecificData={76=[2, 21, -3, -91, 6, -109, -92, -30, 79, -79, -81, -49, -58, -21, 7, 100, 120, 37, 39, 81, 101, -63, -58]}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=RT barcode scanner]
2023-12-16 13:34:20.111  2382-2690  BtGatt.GattService      com.google.android.bluetooth         I  Skipping client for location deny list

But on Android 9, it's acting normal:

 Not a Multi Manu data
2023-12-16 13:37:27.734  1574-1574  ReactNativeBleManager                    I  DiscoverPeripheral: RT barcode scanner
2023-12-16 13:37:27.734  4265-4323  ScanRecord              com.android.bluetooth                D  Not a Multi Manu data

  Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x1 surface={valid=true 523417489408} changed=false
2023-12-16 13:35:43.512  1574-1757  ReactNativeJS           com.wijtransport                     D  '[handleDiscoverPeripheral] new BLE peripheral=', { advertising: 
                                                                                                       { manufacturerData: 
                                                                                                          { '004c': 
                                                                                                             { bytes: 
                                                                                                                [ 2,
                                                                                                                  21,
                                                                                                                  253,
                                                                                                                  165,
                                                                                                                  6,
                                                                                                                  147,
                                                                                                                  164,
                                                                                                                  226,
                                                                                                                  79,
                                                                                                                  177,
                                                                                                                  175,
                                                                                                                  207,
                                                                                                                  198,
                                                                                                                  235,
                                                                                                                  7,
                                                                                                                  100,
                                                                                                                  120,
                                                                                                                  37,
                                                                                                                  39,
                                                                                                                  81,
                                                                                                                  101,
                                                                                                                  193,
                                                                                                                  198 ],
                                                                                                               data: 'AhX9pQaTpOJPsa/PxusHZHglJ1FlwcY=',
                                                                                                               CDVType: 'ArrayBuffer' } },
                                                                                                         txPowerLevel: -2147483648,
                                                                                                         isConnectable: true,
                                                                                                         serviceData: {},
                                                                                                         localName: 'RT barcode scanner',
                                                                                                         serviceUUIDs: [ 'fff0' ],

Additional information

No response

carllewisc commented 4 months ago

@C0zmaCatalin hi, did you resolve your problem? I have a similar problem, i want to know how you have resolved that error