Skip to content

TypeError: null is not an object (evaluating '_$$_REQUIRE(_dependencyMap[6], "./BleModule").BleModule.createClient') #1309

@kch8293

Description

@kch8293

Prerequisites

  • I checked the documentation and FAQ without finding a solution
  • I checked to make sure that this issue has not already been filed

Library version

3.1.2

Platform

Android

Setup Description

Having issue initialising BleManager in App.tsx or any other files in my existing react native project.

My react native version is 0.72.17.

I do not have any issues in a clean 0.72.17 version react native project. I did the same configuration steps on the clean project as the existing one, but I'm having this issue only in my existing project.
Sorry I can't share my existing repo because it's work related.

Steps to Reproduce

Step 1:
npm install --save react-native-ble-plx
Step 2:
In AndroidManifest.xml, add Bluetooth permissions
Step 3:
min SDK version is 23
build.gradle already added jitpack repository to known repositories:
Step 4:
add 2 lines below in App.tsx

import { BleManager } from 'react-native-ble-plx';
const manager = new BleManager();

Relevant log output

TypeError: null is not an object (evaluating '_$$_REQUIRE(_dependencyMap[6], "./BleModule").BleModule.createClient')

Contents of the package.json file

{
"name": HIDDEN,
"version": "1.1.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"compile": "tsc",
"ios": "react-native run-ios",
"android": "adb reverse tcp:9090 tcp:9090 & react-native run-android --variant=devdebug",
"android:clean": "cd android && gradlew clean",
"android:log": "react-native log-android >> log-android.txt",
"android-release": "react-native run-android --variant=devrelease",
"android-store": "react-native run-android --variant=storerelease",
"watch": "npm-watch",
"tsc": "node ./node_modules/typescript/bin/tsc -p ./tsconfig.json --noEmit"
},
"watch": {
"tsc": "src/"
},
"dependencies": {
"@react-native-community/datetimepicker": "^3.5.2",
"@react-native/metro-config": "^0.72.12",
"@react-navigation/bottom-tabs": "^6.0.5",
"@react-navigation/devtools": "^6.0.1",
"@react-navigation/native": "^6.0.2",
"@react-navigation/stack": "^6.0.7",
"apisauce": "^2.1.1",
"appcenter": "1.13.0",
"appcenter-analytics": "1.13.0",
"appcenter-crashes": "1.13.0",
"base-64": "^0.1.0",
"mobx": "^6.1.0",
"mobx-react": "^7.2.0",
"moment": "^2.29.1",
"prop-types": "^15.7.2",
"react": "18.2.0",
"react-i18next": "^11.12.0",
"react-native": "^0.72.17",
"react-native-background-timer": "^2.4.1",
"react-native-ble-plx": "^3.1.2",
"react-native-config": "1.4.5",
"react-native-device-info": "^8.3.1",
"react-native-elements": "^3.4.2",
"react-native-gesture-handler": "^1.10.3",
"react-native-loading-spinner-overlay": "^2.0.0",
"react-native-modal-datetime-picker": "^11.0.0",
"react-native-modals": "^0.22.3",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "3.18.0",
"react-native-status-bar-height": "^2.6.0",
"react-native-uuid-generator": "^5.0.0",
"react-native-webview": "^11.22.7",
"reactotron-react-native": "^5.1.15",
"realm": "^10.22.2",
"reanimated": "0.0.1-alpha",
"rfdc": "^1.3.0",
"string-format": "^2.0.0",
"utf8": "^3.0.0"
},
"devDependencies": {
"@babel/core": "7.20.12",
"@babel/plugin-proposal-class-properties": "^7.12.13",
"@babel/plugin-proposal-decorators": "^7.12.13",
"@babel/plugin-transform-flow-strip-types": "^7.12.13",
"@babel/preset-env": "7.20.2",
"@babel/preset-typescript": "^7.12.13",
"@types/base-64": "^0.1.3",
"@types/jest": "^29.2.1",
"@types/react": "^18.0.24",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.2.1",
"i18next": "^21.0.2",
"jest": "^29.2.1",
"metro-react-native-babel-preset": "^0.76.9",
"npm-watch": "^0.11.0",
"react-art": "18.0.0",
"react-dom": "18.0.0",
"react-native-codegen": "0.0.7",
"react-native-vector-icons": "^8.1.0",
"react-native-web": "^0.17.1",
"react-test-renderer": "18.2.0",
"typescript": "^4.8.4"
},
"jest": {
"preset": "react-native",
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"transform": {
"^.+\.(js)$": "/node_modules/babel-jest",
"\.(ts|tsx)$": "/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/tests/.*|\.(test|spec))\.(ts|tsx|js)$",
"testPathIgnorePatterns": [
"\.snap$",
"/node_modules/"
],
"cacheDirectory": ".jest/cache"
}
}

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions