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.

Undefined is not an object (evaluating '_reactNative.NativeModules.KCKeepAwake.activate) at index.js:506

See original GitHub issue

Previously was having error calling KeepAwake.activate() in both iOS and Android. After going through other issues which suggest a clean node_module install, it did the trick but only for iOS.

I’m getting the error as mentioned in the title on Android.

“react-native”: “^0.55.4”, “react-native-keep-awake”: “^3.2.0”

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
alejandropaciotticommented, Jul 23, 2019

Hi @albertkai , I had the same issue and I resolved it with this:

rm -rf node_modules
yarn

cd android
gradlew clean
cd ..

Removing the app from the device manually.

And then:

react-native start --reset-cache
react-native run-android --deviceId <yourDeviceNumber>
0reactions
ErollIncodekscommented, Mar 30, 2022

rm -rf node_modules then yarn / npm install will fix the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

"'undefined' is not an object" from Native Module in React Native
My problem was that, integrating React Native, the guide on creating native modules did not mention that the package needs to be declared...
Read more >
React Native: undefined is not an object (evaluating '_this ...
Hi everybody, I have a react-native app created with RN CLI, using react-native 0.63, I'm trying to use SectionList but I'm getting the ......
Read more >
Render Error undefined is not an Object (evaluating _react ...
Render Error undefined is not an Object ( evaluating _react.react .createElement) Fixed- React Native.
Read more >
iOS : React Native, NavigatorIOS, undefined is not an object ...
iOS : React Native, NavigatorIOS, undefined is not an object ( evaluating 'this.props.navigator.push') [ Beautify Your Computer ...
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