question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

null is not an object (evaluating 'bleManager.start')

See original GitHub issue

Version

Tell us which versions you are using:

  • react-native-ble-manager v7.3.1
  • expo v38.0.8
  • Android v8.1

Expected behaviour

bleManager.start() should initialize the BLE module

Actual behaviour

throws error: null is not an object (evaluating ‘bleManager.start’)

Steps to reproduce

  1. Create a new project with expo
  2. npm i react-native-ble-manager
  3. Insert following in the main app.js file: useEffect(() => { bleManager.start().then(() => console.log('BLE Module Initialized')).catch(err => console.log(err)) }, [])

Stack trace and console log

null is not an object (evaluating 'bleManager.start')
* http://192.168.1.103:19001/node_modules/expo/AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:134291:20 in <unknown>
- node_modules/promise/setimmediate/core.js:45:6 in tryCallTwo
- node_modules/promise/setimmediate/core.js:200:22 in doResolve
- node_modules/promise/setimmediate/core.js:66:11 in Promise
* http://192.168.1.103:19001/node_modules/expo/AppEntry.bundle?platform=android&dev=true&minify=false&hot=false:134286:26 in start
* App.js:11:12 in useEffect$argument_0
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18008:31 in commitHookEffectList
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18061:28 in commitPassiveHookEffects
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:286:4 in invokeGuardedCallbackImpl
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:497:2 in invokeGuardedCallback
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:21577:27 in flushPassiveEffectsImpl
- node_modules/scheduler/cjs/scheduler.development.js:818:23 in unstable_runWithPriority
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:20435:23 in performSyncWorkOnRoot
* [native code]:null in performSyncWorkOnRoot
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5703:31 in runWithPriority$argument_1
- node_modules/scheduler/cjs/scheduler.development.js:818:23 in unstable_runWithPriority
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5698:21 in flushSyncCallbackQueueImpl
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5686:28 in flushSyncCallbackQueue
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:19845:30 in scheduleUpdateOnFiber
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:23608:14 in updateContainer
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:24593:19 in ReactNativeRenderer.render
- node_modules/react-native/Libraries/ReactNative/renderApplication.js:54:4 in renderApplication
- node_modules/react-native/Libraries/ReactNative/AppRegistry.js:117:25 in runnables.appKey.run
- node_modules/react-native/Libraries/ReactNative/AppRegistry.js:213:4 in runApplication
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:425:19 in __callFunction
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:112:6 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:373:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:111:4 in callFunctionReturnFlushedQueue
* [native code]:null in callFunctionReturnFlushedQueue

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Psalmzzcommented, Apr 22, 2022

have you added the ble_manager to your pod file and ran pod install

pod ‘react-native-ble-manager’, :path => ‘…/node_modules/react-native-ble-manager’

1reaction
Slurpgoosecommented, Nov 1, 2020

@maskaravivek do you have any advice on how to make this work? Ive gone through the install process three times and still have had no luck. after each attempt I deleted package.json & node_modules/

  1. expo eject
  2. npm i --save react-native-ble-manager
  3. update android manifest & ios plist
  4. ran pod install in the ios directory

even though the library supports auto-linking for my second attempt I ran react-native link react-native-ble-manager.

EDIT: I ended up creating a new branch and rerunning the expo eject steps everything seems to be working now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix the error: null is not an object (evaluation of ...
I use the react-native-ble-manager library to connect an Android smartphone to a BLE device. But when calling the BleManager.start () , an ...
Read more >
null is not an object (evaluation of 'bleManager.start')? - Reddit
I use the react-native-ble-manager library to connect an Android smartphone to a BLE device. But when calling the BleManager.start() , an ...
Read more >
RxBLELibraries/react-native-ble - Gitter
Hi, I'm trying to get the bluetooth manager to be initialized in an object, I'm getting "TypeError: null is not an object (evaluating...
Read more >
I can't make run the blemanager.start because promise ...
Coding example for the question I can't make run the blemanager.start because promise rejection id:0 null is not an object-React Native.
Read more >
How to use the react-native-ble-manager.start function ... - Snyk
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found