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.

Trouble with RN 0.44.0

See original GitHub issue

Using:

react-native-cli: 1.2.0
react-native: 0.44.0

Followed instructions for install and usage:

$ npm install --save react-native-keep-awake
$ react-native link

Included package:

import KeepAwake from 'react-native-keep-awake';

Added component to code (in render method):

<KeepAwake />

Nothing else and I get the following: screen shot 2017-05-30 at 12 26 37 am

undefined is not an object (evaluating '_reactNative.NativeModules.KCKeepAwake.activate')
activate
    index.js:8:30
componentWillMount
    index.js:16:4
<unknown>
    ReactCompositeComponent.js:322:16
measureLifeCyclePerf
    ReactCompositeComponent.js:63:11
mountComponent
    ReactCompositeComponent.js:322:10
mountComponent
    ReactReconciler.js:57:6
mountChildren
    ReactMultiChild.js:277:10
initializeChildren
    ReactNativeBaseComponent.js:67:41
mountComponent
    ReactNativeBaseComponent.js:173:6
mountComponent
    ReactReconciler.js:57:6
performInitialMount
    ReactCompositeComponent.js:516:6
mountComponent
    ReactCompositeComponent.js:347:8
mountComponent
    ReactReconciler.js:57:6
performInitialMount
    ReactCompositeComponent.js:516:6
mountComponent
    ReactCompositeComponent.js:347:8
mountComponent
    ReactReconciler.js:57:6
mountChildren
    ReactMultiChild.js:277:10
initializeChildren
    ReactNativeBaseComponent.js:67:41
mountComponent
    ReactNativeBaseComponent.js:173:6
mountComponent
    ReactReconciler.js:57:6
performInitialMount
    ReactCompositeComponent.js:516:6
mountComponent
    ReactCompositeComponent.js:347:8
mountComponent
    ReactReconciler.js:57:6
updateChildren
    ReactChildReconciler.js:165:10
_reconcilerUpdateChildren
    ReactMultiChild.js:223:10
_updateChildren
    ReactMultiChild.js:366:6
updateChildren
    ReactMultiChild.js:352:25
receiveComponent
    ReactNativeBaseComponent.js:118:24
receiveComponent
    ReactReconciler.js:158:38
_updateRenderedComponentWithNextElement
    ReactCompositeComponent.js:1140:8
_updateRenderedComponent
    ReactCompositeComponent.js:1111:6
_performComponentUpdate
    ReactCompositeComponent.js:1032:36
updateComponent
    ReactCompositeComponent.js:915:8
receiveComponent
    ReactCompositeComponent.js:745:6
receiveComponent
    ReactReconciler.js:158:38
updateChildren
    ReactChildReconciler.js:142:10
_reconcilerUpdateChildren
    ReactMultiChild.js:223:10
_updateChildren
    ReactMultiChild.js:366:6
updateChildren
    ReactMultiChild.js:352:25
receiveComponent
    ReactNativeBaseComponent.js:118:24
receiveComponent
    ReactReconciler.js:158:38
_updateRenderedComponentWithNextElement
    ReactCompositeComponent.js:1140:8
_updateRenderedComponent
    ReactCompositeComponent.js:1111:6
_performComponentUpdate
    ReactCompositeComponent.js:1032:36
updateComponent
    ReactCompositeComponent.js:915:8
receiveComponent
    ReactCompositeComponent.js:745:6
receiveComponent
    ReactReconciler.js:158:38
_updateRenderedComponentWithNextElement
    ReactCompositeComponent.js:1140:8
_updateRenderedComponent
    ReactCompositeComponent.js:1111:6
_performComponentUpdate
    ReactCompositeComponent.js:1032:36
updateComponent
    ReactCompositeComponent.js:915:8
performUpdateIfNecessary
    ReactCompositeComponent.js:770:8
performUpdateIfNecessary
    ReactReconciler.js:210:46
runBatchedUpdates
    ReactUpdates.js:146:6
perform
    Transaction.js:150:24
perform
    Transaction.js:150:24
perform
    ReactUpdates.js:78:6
flushBatchedUpdates
    ReactUpdates.js:164:24
closeAll
    Transaction.js:221:29
perform
    Transaction.js:163:24
batchedUpdates
    ReactDefaultBatchingStrategy.js:61:33
batchedUpdates
    ReactUpdates.js:92:41
batchedUpdates
    ReactGenericBatching.js:38:29
batchedUpdatesWithControlledComponents
    ReactGenericBatching.js:51:26
_receiveRootNodeIDEvent
    ReactNativeEventEmitter.js:105:40
receiveTouches
    ReactNativeEventEmitter.js:193:8
__callFunction
    MessageQueue.js:250:47
<unknown>
    MessageQueue.js:101:26
__guard
    MessageQueue.js:218:6
callFunctionReturnFlushedQueue
    MessageQueue.js:100:17

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

2reactions
sdotsoncommented, Jun 6, 2017

I got it working by re-building the app in Android Studio and re-running react-native run-android

0reactions
dezigntimecommented, Oct 31, 2018

I was also having an issue with this, I had it working on 1 machine when i copied it to another it was failing with the “KCKeepAwake.activate”, error; Even after i had ran I had ran react-native link, and even rnpm link.

So Inspecting the ios/build/Build/Products/Debug-iphonesimulator I noticed the compiled libKCKeepAwake.a was not being placed in this folder.

So what I needed to do is open up Xcode

  1. Navigate to Main .xcodeproj General Tab
  2. Add the ‘libKCKeepAwake.a’ to your Linked Frameworks and Libraries section.

not sure at what point the libKCKeepAwake.a gets generated and placed into your workspace, maybe after the the successful build.

After adding it here, reran the build, and that necessary file was now in my ios/build/Build/Products/Debug-iphonesimulator folder, and I was no longer getting the error in my simulator and device.

xcode_keepawake_linking

Hopes this works for someone else running into this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Trouble with RN 0.44.0 - - Bountysource
Coming soon: A brand new website interface for an even better experience!
Read more >
Managing React Native 0.44.0 using yarn; dependency issues ...
When the migration is complete, you will access your Teams at stackoverflowteams.com, and they will no longer appear in the left sidebar on ......
Read more >
react-native-gifted-chat - npm
Use version 0.2.x for RN >= 0.44.0; Use version 0.1.x for RN >= 0.40.0 ... Find response on existing issues; Try to keep...
Read more >
fullstackreact/fullstackreact - Gitter
... entitled Navigator is deprecated in RN 0.44.0 referring to this: https://reactnative.dev/docs/navigation. But the issues thread is more useful.
Read more >
Appropriate Nurse Staffing Levels for U.S. Nursing Homes
Keywords: Nursing homes, nurse staffing, quality, safety ... Facility reports on problems with quality of care, quality of life, and safety problems may...
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