Skip to content
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

Android 13 Support #1072

Closed
3 tasks done
alanCalvillo-Wizeline opened this issue May 19, 2023 · 3 comments
Closed
3 tasks done

Android 13 Support #1072

alanCalvillo-Wizeline opened this issue May 19, 2023 · 3 comments
Labels

Comments

@alanCalvillo-Wizeline
Copy link

alanCalvillo-Wizeline commented May 19, 2023

Prerequisites

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Expected Behavior

I'm using :
compileSdkVersion = 33
targetSdkVersion = 33
ndkVersion = "23.1.7779620"

If I try to use this SDK and NDK version it works well if you have an Android version <13 but if you try to use Android 13 , I'm not able to scan , it seems like this issue has been showed also on a different bluetooth library : innoveit/react-native-ble-manager#943 and it was attended in there.

Please describe the behavior you are expecting
We should move the deprecated versions that are displayed on this innoveit/react-native-ble-manager#943 and trigger a 3.x version

Current Behavior

If we use those NDK and SDK versions it does not work properly on Android 13

What is the current behavior?
It should work well on Android 13

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Scan for BLE devices
  2. Wait for the result..

The expected result is a list of BLE devices and it returns nothing

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. Both JS and platform logs can be enabled via setLogLevel function call.

  • Library version: 2.0.3
  • Platform: Android 13
  • Platform logs (logcat/XCode): logcat
  • JS logs:

LOG Error during scan: [BleError: Cannot start scanning operation]
WARN Possible Unhandled Promise Rejection (id: 1):
TypeError: Cannot read property 'resultScan' of undefined

  • Contents of the package.json file:
    "dependencies": {
    "@gorhom/bottom-sheet": "^5.0.0-alpha.1",
    "@react-native-async-storage/async-storage": "^1.17.11",
    "@react-native-community/datetimepicker": "^6.7.5",
    "@react-native-community/slider": "^4.4.2",
    "@react-navigation/drawer": "^7.0.0-alpha.1",
    "@react-navigation/material-top-tabs": "^7.0.0-alpha.1",
    "@react-navigation/native": "^7.0.0-alpha.1",
    "@react-navigation/native-stack": "^7.0.0-alpha.1",
    "@reduxjs/toolkit": "^1.8.5",
    "@types/redux-logger": "^3.0.9",
    "add": "^2.0.6",
    "clsx": "^1.2.1",
    "i18next": "^22.4.9",
    "jest-fetch-mock": "^3.0.3",
    "mixpanel-react-native": "1.3.6",
    "moment": "^2.29.4",
    "nativewind": "^2.0.11",
    "ramda": "^0.28.0",
    "react": "18.2.0",
    "react-dom": "^18.2.0",
    "react-i18next": "^12.1.5",
    "react-native": "^0.71.5",
    "react-native-app-auth": "^7.0.0-rc2",
    "react-native-ble-plx": "^2.0.3",
    "react-native-blob-util": "^0.17.2",
    "react-native-gesture-handler": "^2.9.0",
    "react-native-get-random-values": "^1.8.0",
    "react-native-localize": "^2.2.4",
    "react-native-pager-view": "^7.0.0-rc.0",
    "react-native-pdf": "^6.6.2",
    "react-native-permissions": "^3.6.1",
    "react-native-reanimated": "^3.1.0",
    "react-native-safe-area-context": "^4.5.2",
    "react-native-screens": "^3.18.2",
    "react-native-svg": "^13.9.0",
    "react-native-tab-view": "^3.5.1",
    "react-native-vector-icons": "^9.2.0",
    "react-native-web": "^0.18.12",
    "react-native-webview": "^11.23.1",
    "react-native-wifi-reborn": "^4.7.0",
    "react-redux": "^8.0.4",
    "redux-logger": "^3.0.6",
    "redux-observable": "^2.0.0",
    "reduxjs-toolkit-persist": "^7.2.1",
    "rpc-websockets": "^7.5.1",
    "rxjs": "^7.5.7",
    "setimmediate": "^1.0.5",
    "swagger-client": "3.18.5",
    "uuid": "^9.0.0",
    "yarn": "^1.22.19"
    },

  • Formatted code sample or link to a repository:
    `const resultScan: Result[] = [];
    manager.startDeviceScan(null, null, async (error, device) => {
    if (error) {
    trackErrorMixpanel({ mixpanelMeta, error });
    eventEmitter.emit(BluetoothEvents.SCANNING_ERROR, error);
    reject(error);
    }

    if (device) {
      foundList = await updateFoundList(foundList, device);
    
      setItem('foundList', foundList);
      savePVSSN(foundList);
      eventEmitter.emit(BluetoothEvents.SCANNING_RESULT, foundList);
      const result: Result = {
        deviceId: device.id,
        deviceName: await getDeviceName(device),
        deviceLocalName: device.localName,
        numberOfFoundDevices: foundList.length,
      };
      resultScan.push(result);
    }
    

    });`

@alanCalvillo-Wizeline
Copy link
Author

I found the solution.

image

I just had to add these permissions to it.

@roysG
Copy link

roysG commented Jul 4, 2023

Hi @alanCalvillo-Wizeline,
Does it also compatible with previous versions?

@alanCalvillo-Wizeline
Copy link
Author

alanCalvillo-Wizeline commented Jul 4, 2023

hello @roysG
so far , yes it is compatible with previous versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants