dotintent / react-native-ble-plx

React Native BLE library
Apache License 2.0
3.04k stars 508 forks source link

startDeviceScan() responding #660

Closed ShashwatMDas closed 4 years ago

ShashwatMDas commented 4 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

Setup problem

So I have everything setup properly( I guess). So what happens is, whenever I am trying to call startDeviceScan(), it is not being called or is stuck at something, no clue!

Context

Here's my code:

`constructor() {
    super()
    this.manager = new BleManager()
    this.state = {info: "", values: {}}

    this.scanAndConnect = this.scanAndConnect.bind(this);
  }

   info(message) {
    this.setState({info: message})
  }

  error(message) {
    this.setState({info: "ERROR: " + message})
  }

  updateValue(key, value) {
    this.setState({values: {...this.state.values, [key]: value}})
  }

   componentDidMount() {
    if (Platform.OS === 'ios') {
      this.manager.onStateChange((state) => {
        if (state === 'PoweredOn') this.scanAndConnect()
      })
    } else {
      this.scanAndConnect()
    }
async function requestLocationPermission() 
{
  try {
    const granted = await PermissionsAndroid.request(
      PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
      {
        'title': 'Example App',
        'message': 'Example App access to your location '
      }
    )
    if (granted === PermissionsAndroid.RESULTS.GRANTED) {
      console.log("You can use the location")
      alert("You can use the location");
    } else {
      console.log("location permission denied")
      alert("Location permission denied");
    }
  } catch (err) {
    console.warn(err)
  }
}
requestLocationPermission();
  }

    scanAndConnect() {
      this.info("Start Scan");
      console.log("Scanning")
    this.manager.startDeviceScan(null,
                                 null, (error, device) => {
      this.info("Scanning...")
      console.log(device)

      if (error) {
        this.error(error.message, )
        return
      }

      if(device) console.log(device);
      if (device.id === 'F4:BC:DA:57:D7:CC' || device.name === 'JBL Flip 3 SE') {
        this.info("Connecting to JBL FLip")
        this.manager.stopDeviceScan()
        device.connect()
          .then((device) => {
            console.log("Yohooo");
            this.info("Discovering services and characteristics")
            return device.discoverAllServicesAndCharacteristics()
          }).catch(err => console.log(err));
          // .then((device) => {
          //   this.info("Setting notifications")
          //   return this.setupNotifications(device)
          // // })
          // .then(() => {
          //   this.info("Listening...")
          // }, (error) => {
          //   this.error(error.message)
          // })
      }
    });
  }
`

Here's my console log: [Sun May 03 2020 01:36:31.321] LOG Running "nativeapp" with {"rootTag":131} [Sun May 03 2020 01:36:31.323] LOG Scanning [Sun May 03 2020 01:36:31.324] LOG You can use the location [Sun May 03 2020 01:37:19.260] LOG Scanning [Sun May 03 2020 01:37:19.640] LOG You can use the location

Here's the package.json :


{
  "name": "nativeapp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@remobile/react-native-toast": "^1.0.7",
    "jshint": "^2.11.0",
    "react": "16.11.0",
    "react-native": "0.62.2",
    "react-native-ble-plx": "^2.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.9.6",
    "@babel/runtime": "^7.9.6",
    "@react-native-community/eslint-config": "^1.1.0",
    "babel-jest": "^25.5.1",
    "eslint": "^6.8.0",
    "jest": "^25.5.3",
    "metro-react-native-babel-preset": "^0.59.0",
    "react-test-renderer": "16.11.0"
  },
  "jest": {
    "preset": "react-native"
  }
}
dariuszseweryn commented 4 years ago

What platform do you test on? Where are native logs as per the issue template request?

ShashwatMDas commented 4 years ago

What platform do you test on? Where are native logs as per the issue template request?

Hey, I'm using OnePlus 6, Android 10 (OxygenOS version 10.3.1). The logcat log is as follows:

2020-05-03 03:54:15.619 10605-10793/com.nativeapp I/ReactNativeJS: Scanning
2020-05-03 03:54:15.638 10605-10809/com.nativeapp D/BluetoothAdapter: isLeEnabled(): ON
2020-05-03 03:54:15.643 10605-10809/com.nativeapp D/BluetoothAdapter: isLeEnabled(): ON
2020-05-03 03:54:15.648 10605-10627/com.nativeapp D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=9 mScannerId=0
2020-05-03 03:54:58.157 10605-10624/com.nativeapp D/DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@9c7b867[MainActivity]
2020-05-03 03:54:58.159 10605-10605/com.nativeapp E/SensorManager: unregisterListenerImpl callingApp: com.nativeapp,callingPid:10605,callingUid:10426
dariuszseweryn commented 4 years ago

Do you have permission for fine location granted? Are Location Services on?

ShashwatMDas commented 4 years ago

Do you have permission for fine location granted? Are Location Services on?

Yes, fine location permissions are granted and are checked everytime the app refreshes, so that won't be an issue.

dariuszseweryn commented 4 years ago

And what about Location Services (GPS)?

ShashwatMDas commented 4 years ago

And what about Location Services (GPS)?

As per the docs, we were required to include this: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Also react native docs also state the same thing for geolocation services. Is anything else required?

dariuszseweryn commented 4 years ago

Location Services. Top bar (usually), location switch — must be turned on. This is something different than Location Permission. Both are needed.

Afair the library should raise an error if it is off when starting the scan but I cannot be sure if it does on this new Android.

ShashwatMDas commented 4 years ago

Yes, the location switch is on and the app is able to receive location services from the phone. Even bluetooth services are properly received. startDeviceScan method return this error if I turn of bluetooth: BluetoothLE is powered off Which means the library should be integrated fine. It's just that whenever bluetooth is on and it should be scanning for devices, the method doesn't show any logs.

dariuszseweryn commented 4 years ago

Could you show native logs after you have set the log level to Verbose in the library?

ShashwatMDas commented 4 years ago
2020-05-03 14:01:09.547 14709-14741/com.nativeapp D/DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@2f8f426[MainActivity]
2020-05-03 14:01:10.341 14709-14801/com.nativeapp I/ReactNativeJS: Scanning
2020-05-03 14:01:10.372 14709-16269/com.nativeapp D/BluetoothAdapter: isLeEnabled(): ON
2020-05-03 14:01:10.376 14709-14741/com.nativeapp D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=9 mScannerId=0
2020-05-03 14:01:21.136 14709-14709/com.nativeapp E/SensorManager: unregisterListenerImpl callingApp: com.nativeapp,callingPid:14709,callingUid:10426
2020-05-03 14:03:07.116 14709-14709/com.nativeapp E/SensorManager: registerListenerImpl sensorName:BMI160_ACCELEROMETER Accelerometer Non-wakeup,isWakeUpSensor:false,callingApp: com.nativeapp,callingPid:14709,callingUid:10426
2020-05-03 14:03:07.131 14709-17014/com.nativeapp W/unknown:ReconnectingWebSocket: Couldn't connect to "ws://localhost:8081/message?device=ONEPLUS%20A6000%20-%2010%20-%20API%2029&app=com.nativeapp&clientid=DevSupportManagerImpl", will silently retry
2020-05-03 14:03:07.133 14709-14771/com.nativeapp D/DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@2f8f426[MainActivity]
2020-05-03 14:03:12.283 14709-14801/com.nativeapp I/ReactNativeJS: Scanning
2020-05-03 14:03:12.299 14709-16269/com.nativeapp D/BluetoothAdapter: isLeEnabled(): ON
2020-05-03 14:03:12.303 14709-16269/com.nativeapp D/BluetoothAdapter: isLeEnabled(): ON
2020-05-03 14:03:12.309 14709-14771/com.nativeapp D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=9 mScannerId=0

This is the complete log with log level verbose

dariuszseweryn commented 4 years ago

Nope. I mean, again, per issue template: setLogLevel. I see no native logs from the library in what you just pasted. Please set the library log level to verbose as well and then paste the logs.

ShashwatMDas commented 4 years ago

Yeah so i did this, this.manager.setLogLevel(LogLevel.Verbose);

I have pasted the complete log over here (since I have no idea what all information you are looking for). Thanks

2020-05-03 14:25:28.437 25031-25031/? I/com.nativeapp: Late-enabling -Xcheck:jni
2020-05-03 14:25:28.453 25031-25031/? E/com.nativeapp: Unknown bits set in runtime_flags: 0x8000
2020-05-03 14:25:28.628 25031-25031/com.nativeapp I/Perf: Connecting to perf service.
2020-05-03 14:25:28.633 25031-25031/com.nativeapp V/Font: Change font:2
2020-05-03 14:25:28.634 25031-25031/com.nativeapp V/Font: Default family:android.graphics.Typeface@1cdaafdc
2020-05-03 14:25:28.637 25031-25031/com.nativeapp D/SoLoader: init start
2020-05-03 14:25:28.637 25031-25031/com.nativeapp D/SoLoader: adding system library source: /vendor/lib
2020-05-03 14:25:28.637 25031-25031/com.nativeapp D/SoLoader: adding system library source: /system/lib
2020-05-03 14:25:28.637 25031-25031/com.nativeapp D/SoLoader: adding application source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.nativeapp-O_7G3vjEaJGtU-Udc76n0Q==/lib/arm64 flags = 0]
2020-05-03 14:25:28.639 25031-25031/com.nativeapp D/SoLoader: adding backup source from : com.facebook.soloader.ApkSoSource[root = /data/data/com.nativeapp/lib-main flags = 1]
2020-05-03 14:25:28.639 25031-25031/com.nativeapp D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /system/lib flags = 2]
2020-05-03 14:25:28.639 25031-25031/com.nativeapp D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /vendor/lib flags = 2]
2020-05-03 14:25:28.639 25031-25031/com.nativeapp D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.nativeapp-O_7G3vjEaJGtU-Udc76n0Q==/lib/arm64 flags = 0]
2020-05-03 14:25:28.639 25031-25031/com.nativeapp D/SoLoader: Preparing SO source: com.facebook.soloader.ApkSoSource[root = /data/data/com.nativeapp/lib-main flags = 1]
2020-05-03 14:25:28.640 25031-25031/com.nativeapp V/fb-UnpackingSoSource: locked dso store /data/user/0/com.nativeapp/lib-main
2020-05-03 14:25:28.641 25031-25031/com.nativeapp I/fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.nativeapp/lib-main
2020-05-03 14:25:28.641 25031-25031/com.nativeapp V/fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.nativeapp/lib-main
2020-05-03 14:25:28.641 25031-25031/com.nativeapp D/SoLoader: init finish: 4 SO sources prepared
2020-05-03 14:25:28.641 25031-25031/com.nativeapp D/SoLoader: init exiting
2020-05-03 14:25:28.650 25031-25031/com.nativeapp D/SoLoader: init exiting
2020-05-03 14:25:28.651 25031-25031/com.nativeapp D/SoLoader: About to load: libjscexecutor.so
2020-05-03 14:25:28.651 25031-25031/com.nativeapp D/SoLoader: libjscexecutor.so not found on /data/data/com.nativeapp/lib-main
2020-05-03 14:25:28.651 25031-25031/com.nativeapp D/SoLoader: libjscexecutor.so found on /data/app/com.nativeapp-O_7G3vjEaJGtU-Udc76n0Q==/lib/arm64
2020-05-03 14:25:28.651 25031-25031/com.nativeapp D/SoLoader: Not resolving dependencies for libjscexecutor.so
2020-05-03 14:25:28.659 25031-25031/com.nativeapp D/JavaScriptCore.Version: 245459.0.0
2020-05-03 14:25:28.660 25031-25031/com.nativeapp D/SoLoader: Loaded: libjscexecutor.so
2020-05-03 14:25:28.660 25031-25031/com.nativeapp D/ReactNative: ReactInstanceManager.ctor()
2020-05-03 14:25:28.660 25031-25031/com.nativeapp D/SoLoader: init exiting
2020-05-03 14:25:28.679 25031-25031/com.nativeapp D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2020-05-03 14:25:28.682 25031-25031/com.nativeapp W/com.nativeapp: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setUseSessionTickets(Z)V (greylist,core-platform-api, reflection, allowed)
2020-05-03 14:25:28.682 25031-25031/com.nativeapp W/com.nativeapp: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setHostname(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed)
2020-05-03 14:25:28.682 25031-25031/com.nativeapp W/com.nativeapp: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->getAlpnSelectedProtocol()[B (greylist,core-platform-api, reflection, allowed)
2020-05-03 14:25:28.682 25031-25031/com.nativeapp W/com.nativeapp: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setAlpnProtocols([B)V (greylist,core-platform-api, reflection, allowed)
2020-05-03 14:25:28.682 25031-25031/com.nativeapp W/com.nativeapp: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, reflection, allowed)
2020-05-03 14:25:28.682 25031-25031/com.nativeapp W/com.nativeapp: Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed)
2020-05-03 14:25:28.682 25031-25031/com.nativeapp W/com.nativeapp: Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, reflection, allowed)
2020-05-03 14:25:28.690 25031-25031/com.nativeapp E/SensorManager: registerListenerImpl sensorName:BMI160_ACCELEROMETER Accelerometer Non-wakeup,isWakeUpSensor:false,callingApp: com.nativeapp,callingPid:25031,callingUid:10426
2020-05-03 14:25:28.706 25031-25084/com.nativeapp D/SoLoader: About to load: libfbjni.so
2020-05-03 14:25:28.706 25031-25084/com.nativeapp D/SoLoader: libfbjni.so not found on /data/data/com.nativeapp/lib-main
2020-05-03 14:25:28.706 25031-25084/com.nativeapp D/SoLoader: libfbjni.so found on /data/app/com.nativeapp-O_7G3vjEaJGtU-Udc76n0Q==/lib/arm64
2020-05-03 14:25:28.706 25031-25084/com.nativeapp D/SoLoader: Not resolving dependencies for libfbjni.so
2020-05-03 14:25:28.707 25031-25084/com.nativeapp D/SoLoader: Loaded: libfbjni.so
2020-05-03 14:25:28.707 25031-25084/com.nativeapp D/SoLoader: About to load: libflipper.so
2020-05-03 14:25:28.708 25031-25084/com.nativeapp D/SoLoader: libflipper.so not found on /data/data/com.nativeapp/lib-main
2020-05-03 14:25:28.708 25031-25084/com.nativeapp D/SoLoader: libflipper.so found on /data/app/com.nativeapp-O_7G3vjEaJGtU-Udc76n0Q==/lib/arm64
2020-05-03 14:25:28.708 25031-25084/com.nativeapp D/SoLoader: Not resolving dependencies for libflipper.so
2020-05-03 14:25:28.713 25031-25084/com.nativeapp D/SoLoader: Loaded: libflipper.so
2020-05-03 14:25:28.727 25031-25031/com.nativeapp W/com.nativeapp: Accessing hidden field Landroid/view/View;->mKeyedTags:Landroid/util/SparseArray; (greylist, reflection, allowed)
2020-05-03 14:25:28.727 25031-25031/com.nativeapp W/com.nativeapp: Accessing hidden field Landroid/view/View;->mListenerInfo:Landroid/view/View$ListenerInfo; (greylist, reflection, allowed)
2020-05-03 14:25:28.727 25031-25031/com.nativeapp W/com.nativeapp: Accessing hidden field Landroid/view/View$ListenerInfo;->mOnClickListener:Landroid/view/View$OnClickListener; (greylist, reflection, allowed)
2020-05-03 14:25:28.731 25031-25031/com.nativeapp I/flipper: flipper: FlipperClient::addPlugin Inspector
2020-05-03 14:25:28.731 25031-25031/com.nativeapp I/flipper: flipper: FlipperClient::addPlugin React
2020-05-03 14:25:28.732 25031-25031/com.nativeapp I/flipper: flipper: FlipperClient::addPlugin Databases
2020-05-03 14:25:28.734 25031-25031/com.nativeapp I/flipper: flipper: FlipperClient::addPlugin Preferences
2020-05-03 14:25:28.734 25031-25031/com.nativeapp I/flipper: flipper: FlipperClient::addPlugin CrashReporter
2020-05-03 14:25:28.737 25031-25031/com.nativeapp I/flipper: flipper: FlipperClient::addPlugin Network
2020-05-03 14:25:28.741 25031-25098/com.nativeapp E/Perf: Fail to get file list com.nativeapp
2020-05-03 14:25:28.741 25031-25098/com.nativeapp E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
2020-05-03 14:25:28.742 25031-25098/com.nativeapp E/Perf: Fail to get file list com.nativeapp
2020-05-03 14:25:28.742 25031-25098/com.nativeapp E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
2020-05-03 14:25:28.784 25031-25031/com.nativeapp D/ReactNative: ReactInstanceManager.createReactContextInBackground()
2020-05-03 14:25:28.784 25031-25031/com.nativeapp D/ReactNative: ReactInstanceManager.recreateReactContextInBackgroundInner()
2020-05-03 14:25:28.804 25031-25031/com.nativeapp W/com.nativeapp: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2020-05-03 14:25:28.805 25031-25031/com.nativeapp W/com.nativeapp: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2020-05-03 14:25:28.824 25031-25031/com.nativeapp V/ViewRootImpl: The specified message queue synchronization  barrier token has not been posted or has already been removed
2020-05-03 14:25:28.832 25031-25031/com.nativeapp W/unknown:ReactNative: Packager connection already open, nooping.
2020-05-03 14:25:28.839 25031-25052/com.nativeapp D/DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@6f02cb2[MainActivity]
2020-05-03 14:25:28.840 25031-25099/com.nativeapp I/AdrenoGLES: QUALCOMM build                   : 35556ba, I9ca166462c
    Build Date                       : 08/07/19
    OpenGL ES Shader Compiler Version: EV031.27.02.00
    Local Branch                     : 
    Remote Branch                    : 
    Remote Branch                    : 
    Reconstruct Branch               : 
2020-05-03 14:25:28.840 25031-25099/com.nativeapp I/AdrenoGLES: Build Config                     : S P 8.0.8 AArch64
2020-05-03 14:25:28.843 25031-25099/com.nativeapp I/AdrenoGLES: PFP: 0x016ee187, ME: 0x00000000
2020-05-03 14:25:28.854 25031-25099/com.nativeapp W/Gralloc3: mapper 3.x is not supported
2020-05-03 14:25:28.884 25031-25031/com.nativeapp V/ViewRootImpl: The specified message queue synchronization  barrier token has not been posted or has already been removed
2020-05-03 14:25:29.057 25031-25031/com.nativeapp D/ReactNative: ReactInstanceManager.onJSBundleLoadedFromServer()
2020-05-03 14:25:29.058 25031-25031/com.nativeapp D/ReactNative: ReactInstanceManager.recreateReactContextInBackground()
2020-05-03 14:25:29.058 25031-25031/com.nativeapp D/ReactNative: ReactInstanceManager.runCreateReactContextOnNewThread()
2020-05-03 14:25:29.059 25031-25109/com.nativeapp D/SoLoader: About to load: libreactnativejni.so
2020-05-03 14:25:29.060 25031-25109/com.nativeapp D/SoLoader: libreactnativejni.so not found on /data/data/com.nativeapp/lib-main
2020-05-03 14:25:29.060 25031-25109/com.nativeapp D/SoLoader: libreactnativejni.so found on /data/app/com.nativeapp-O_7G3vjEaJGtU-Udc76n0Q==/lib/arm64
2020-05-03 14:25:29.060 25031-25109/com.nativeapp D/SoLoader: Not resolving dependencies for libreactnativejni.so
2020-05-03 14:25:29.061 25031-25109/com.nativeapp D/SoLoader: Loaded: libreactnativejni.so
2020-05-03 14:25:29.061 25031-25109/com.nativeapp D/ReactNative: ReactInstanceManager.createReactContext()
2020-05-03 14:25:29.080 25031-25109/com.nativeapp D/ReactNative: Initializing React Xplat Bridge.
2020-05-03 14:25:29.082 25031-25109/com.nativeapp D/ReactNative: Initializing React Xplat Bridge before initializeBridge
2020-05-03 14:25:29.087 25031-25109/com.nativeapp D/ReactNative: Initializing React Xplat Bridge after initializeBridge
2020-05-03 14:25:29.087 25031-25109/com.nativeapp D/ReactNative: CatalystInstanceImpl.runJSBundle()
2020-05-03 14:25:29.088 25031-25111/com.nativeapp D/ReactNative: ReactInstanceManager.setupReactContext()
2020-05-03 14:25:29.088 25031-25111/com.nativeapp D/ReactNative: CatalystInstanceImpl.initialize()
2020-05-03 14:25:29.091 25031-25111/com.nativeapp D/ReactNative: ReactInstanceManager.attachRootViewToInstance()
2020-05-03 14:25:29.092 25031-25031/com.nativeapp W/unknown:ReactNative: Packager connection already open, nooping.
2020-05-03 14:25:29.114 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupViewManager
2020-05-03 14:25:29.115 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupShadowNode
2020-05-03 14:25:29.117 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeViewManager
2020-05-03 14:25:29.117 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeShadowNode
2020-05-03 14:25:29.118 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextViewManager
2020-05-03 14:25:29.118 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextShadowNode
2020-05-03 14:25:29.119 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.checkbox.ReactCheckBoxManager
2020-05-03 14:25:29.121 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
2020-05-03 14:25:29.124 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDialogPickerManager
2020-05-03 14:25:29.126 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
2020-05-03 14:25:29.126 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDropdownPickerManager
2020-05-03 14:25:29.127 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
2020-05-03 14:25:29.130 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager
2020-05-03 14:25:29.131 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
2020-05-03 14:25:29.132 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
2020-05-03 14:25:29.133 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
2020-05-03 14:25:29.135 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager
2020-05-03 14:25:29.137 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager$ReactSliderShadowNode
2020-05-03 14:25:29.138 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
2020-05-03 14:25:29.139 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
2020-05-03 14:25:29.140 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
2020-05-03 14:25:29.141 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewManager
2020-05-03 14:25:29.141 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewShadowNode
2020-05-03 14:25:29.142 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
2020-05-03 14:25:29.142 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
2020-05-03 14:25:29.143 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
2020-05-03 14:25:29.145 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
2020-05-03 14:25:29.146 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
2020-05-03 14:25:29.146 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
2020-05-03 14:25:29.146 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextShadowNode
2020-05-03 14:25:29.147 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
2020-05-03 14:25:29.150 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode
2020-05-03 14:25:29.152 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
2020-05-03 14:25:29.154 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode
2020-05-03 14:25:29.154 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
2020-05-03 14:25:29.156 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager
2020-05-03 14:25:29.157 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
2020-05-03 14:25:29.158 25031-25111/com.nativeapp W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextShadowNode
2020-05-03 14:25:29.168 25031-25111/com.nativeapp D/SoLoader: About to load: libyoga.so
2020-05-03 14:25:29.168 25031-25111/com.nativeapp D/SoLoader: libyoga.so not found on /data/data/com.nativeapp/lib-main
2020-05-03 14:25:29.168 25031-25111/com.nativeapp D/SoLoader: libyoga.so found on /data/app/com.nativeapp-O_7G3vjEaJGtU-Udc76n0Q==/lib/arm64
2020-05-03 14:25:29.168 25031-25111/com.nativeapp D/SoLoader: Not resolving dependencies for libyoga.so
2020-05-03 14:25:29.169 25031-25111/com.nativeapp D/SoLoader: Loaded: libyoga.so
2020-05-03 14:25:29.183 25031-25111/com.nativeapp D/SoLoader: init exiting
2020-05-03 14:25:29.200 25031-25111/com.nativeapp I/flipper: flipper: FlipperClient::addPlugin Fresco
2020-05-03 14:25:29.251 25031-25031/com.nativeapp D/ReactNative: ReactInstanceManager.createReactContextInBackground()
2020-05-03 14:25:29.251 25031-25031/com.nativeapp D/ReactNative: ReactInstanceManager.attachRootViewToInstance()
2020-05-03 14:25:29.282 25031-25110/com.nativeapp D/SoLoader: About to load: libreactnativeblob.so
2020-05-03 14:25:29.283 25031-25110/com.nativeapp D/SoLoader: libreactnativeblob.so not found on /data/data/com.nativeapp/lib-main
2020-05-03 14:25:29.283 25031-25110/com.nativeapp D/SoLoader: libreactnativeblob.so found on /data/app/com.nativeapp-O_7G3vjEaJGtU-Udc76n0Q==/lib/arm64
2020-05-03 14:25:29.283 25031-25110/com.nativeapp D/SoLoader: Not resolving dependencies for libreactnativeblob.so
2020-05-03 14:25:29.284 25031-25110/com.nativeapp D/SoLoader: Loaded: libreactnativeblob.so
2020-05-03 14:25:29.297 25031-25111/com.nativeapp I/WebViewFactory: Loading com.google.android.webview version 80.0.3987.149 (code 398714933)
2020-05-03 14:25:29.331 25031-25111/com.nativeapp I/cr_LibraryLoader: Loaded native library version number "80.0.3987.149"
2020-05-03 14:25:29.493 25031-25110/com.nativeapp I/ReactNativeJS: Running "nativeapp" with {"rootTag":1}
2020-05-03 14:25:29.553 25031-25110/com.nativeapp I/ReactNativeJS: Scanning
2020-05-03 14:25:29.558 25031-25031/com.nativeapp W/com.nativeapp: Accessing hidden field Landroid/view/View;->mAccessibilityDelegate:Landroid/view/View$AccessibilityDelegate; (greylist, reflection, allowed)
2020-05-03 14:25:29.568 25031-25111/com.nativeapp D/RxBle#ClientOperationQueue: QUEUED   ScanOperationApi21(189904923)
2020-05-03 14:25:29.570 25031-25130/com.nativeapp D/RxBle#ClientOperationQueue: STARTED  ScanOperationApi21(189904923)
2020-05-03 14:25:29.573 25031-25133/com.nativeapp I/RxBle#QueueOperation: Scan operation is requested to start.
2020-05-03 14:25:29.574 25031-25133/com.nativeapp D/BluetoothAdapter: isLeEnabled(): ON
2020-05-03 14:25:29.576 25031-25052/com.nativeapp D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=6 mScannerId=0
2020-05-03 14:25:29.580 25031-25130/com.nativeapp D/RxBle#ClientOperationQueue: FINISHED ScanOperationApi21(189904923) in 9 ms
2020-05-03 14:25:29.592 25031-25031/com.nativeapp D/OnePlusJankManager:  Chor uploadMDM JANK_TYPE_NODRAW mViewTitle = com.nativeapp/com.nativeapp.MainActivity--- jank level = 1
2020-05-03 14:25:29.600 25031-25110/com.nativeapp I/ReactNativeJS: You can use the location
2020-05-03 14:25:29.623 25031-25031/com.nativeapp V/FlingOptimizerScroller: FlingOptimizerOverScroller Init
2020-05-03 14:25:29.637 25031-25031/com.nativeapp V/ViewRootImpl: The specified message queue synchronization  barrier token has not been posted or has already been removed
2020-05-03 14:25:29.657 25031-25052/com.nativeapp D/DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@ed515c[MainActivity]
2020-05-03 14:25:29.666 25031-25031/com.nativeapp W/Choreographer: Already have a pending vsync event.  There should only be one at a time.
dariuszseweryn commented 4 years ago

These are the interesting bits on Android:

2020-05-03 14:25:29.568 25031-25111/com.nativeapp D/RxBle#ClientOperationQueue: QUEUED   ScanOperationApi21(189904923)
2020-05-03 14:25:29.570 25031-25130/com.nativeapp D/RxBle#ClientOperationQueue: STARTED  ScanOperationApi21(189904923)
2020-05-03 14:25:29.573 25031-25133/com.nativeapp I/RxBle#QueueOperation: Scan operation is requested to start.
2020-05-03 14:25:29.574 25031-25133/com.nativeapp D/BluetoothAdapter: isLeEnabled(): ON
2020-05-03 14:25:29.576 25031-25052/com.nativeapp D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=6 mScannerId=0
2020-05-03 14:25:29.580 25031-25130/com.nativeapp D/RxBle#ClientOperationQueue: FINISHED ScanOperationApi21(189904923) in 9 ms

Scanning seems to start normally. Could you check if nRF Connect application will show any devices?

I have several ideas:

  1. Bluetooth stack on your phone has gone off. Try restarting the phone
  2. You try to connect to a device that is not a BLE peripheral but a classic Bluetooth one
  3. Your device is already connected to the phone so it is not advertising itself
ShashwatMDas commented 4 years ago

These are the interesting bits on Android:

2020-05-03 14:25:29.568 25031-25111/com.nativeapp D/RxBle#ClientOperationQueue: QUEUED   ScanOperationApi21(189904923)
2020-05-03 14:25:29.570 25031-25130/com.nativeapp D/RxBle#ClientOperationQueue: STARTED  ScanOperationApi21(189904923)
2020-05-03 14:25:29.573 25031-25133/com.nativeapp I/RxBle#QueueOperation: Scan operation is requested to start.
2020-05-03 14:25:29.574 25031-25133/com.nativeapp D/BluetoothAdapter: isLeEnabled(): ON
2020-05-03 14:25:29.576 25031-25052/com.nativeapp D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=6 mScannerId=0
2020-05-03 14:25:29.580 25031-25130/com.nativeapp D/RxBle#ClientOperationQueue: FINISHED ScanOperationApi21(189904923) in 9 ms

Scanning seems to start normally. Could you check if nRF Connect application will show any devices?

I have several ideas:

  1. Bluetooth stack on your phone has gone off. Try restarting the phone
  2. You try to connect to a device that is not a BLE peripheral but a classic Bluetooth one
  3. Your device is already connected to the phone so it is not advertising itself

Sorry for late reply, got caught up in work. Thanks a lot it worked. Turns out restarting the phone was all I needed to do. Closing the issue with this.