Closed blood-romantic closed 3 weeks ago
Hi @blood-romantic, Thanks for reaching out. We'll check the issue and get back to you with a solution proposal soon.
@blood-romantic Can you double-check what happens when you add some options?
const options: BleManagerOptions = {
restoreStateIdentifier: "BleInTheBackground",
restoreStateFunction: (restoredState) => {
if (restoredState == null) {
console.log("BleManager was constructed for the first time.");
} else {
console.log(
"BleManager BleManager was restored.",
restoredState.connectedPeripherals
);
}
}
};
export let ble = new BleManager(options);
npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.73.3 wanted: 0.73.3 react-native-macos: Not Found
Seems you need to install the module first:
npm i react-native-ble-plx
@cixio I can see the module the module @react-native-community/cli in the node_modulel, i'm not sure why show Not Found
npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.73.3 wanted: 0.73.3 react-native-macos: Not Found
Seems you need to install the module first:
npm i react-native-ble-plx
can you verify that the folder modules/react-native-ble-plx exists?
@blood-romantic Could you create a new project and install only react-native-ble-plx and check if problems still exist or even better show this repository? Before I start investigating this problem, I would like to exclude any potential environmental issues.
Close this issue, after reinstall the dependency, it is ok
Prerequisites
Expected Behavior
The BleManager should not be undefine when importing
import {BleManager, BleError} from 'react-native-ble-plx';
Current Behavior
The BleManager is undefine when importing
import {BleManager, BleError} from 'react-native-ble-plx';
Library version
3.1.2
Device
Pixel 7
Environment info
Steps to reproduce
The BleManager is undefined here
Formatted code sample or link to a repository
Relevant log output
Additional information
React Native: 0.73.3 JDK: 17 Nodejs: 21.5.0 Android SDK: 34
AndroidManifest.xml
build.gradle