react-native-device-info: NativeModule.RNDeviceInfo is null on RN 0.59.10
Bug
Dear all,
I am upgrading my app from RN 0.53 to RN 0.59.10 and it’s been a day I’m facing the following bug after the app successfully compiles:
*** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: @react-native-community/react-native-device-info: NativeModule.RNDeviceInfo is null.
I have upgraded to the package version to the last one (i.e. 2.3.2), I’ve tried to follow the instructions given, I’ve tried to unlink, uninstall, install, link, pod install, but still, the issue remains. I’ve also added the piece of code inside react-native-config.js.
Environment info
React native info output:
React Native Environment Info:
System:
OS: macOS 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i7-6660U CPU @ 2.40GHz
Memory: 149.80 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.7.0 - /usr/local/Cellar/node/12.7.0/bin/node
Yarn: 1.12.3 - ~/.yarn/bin/yarn
npm: 6.10.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28
Build Tools: 23.0.1, 23.0.2, 25.0.1, 25.0.2, 26.0.1, 27.0.3, 28.0.2, 28.0.3
System Images: a...s_playstore | Google Play Intel x86 Atom Sys...
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5314842
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: ^0.59.10 => 0.59.10
npmGlobalPackages:
react-native-cli: 2.0.1
Library version: 2.3.2
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18
Commits related to this issue
- Info for #748 — committed to react-native-device-info/react-native-device-info by Speedy1991 5 years ago
- ios build: Start using CocoaPods again. There was an attempt to use CocoaPods in aded466, 2017-03-19. That was removed in 4096e71, 2017-07-18. Some cleanup was done in 861744b, 2020-02-05. To para... — committed to chrisbobbe/zulip-mobile by deleted user 4 years ago
- ios build: Start using CocoaPods again. There was an attempt to use CocoaPods in aded466, 2017-03-19. That was removed in 4096e71, 2017-07-18. Some cleanup was done in 861744b, 2020-02-05. To para... — committed to chrisbobbe/zulip-mobile by deleted user 4 years ago
- ios build: Start using CocoaPods again. There was an attempt to use CocoaPods in aded466, 2017-03-19. That was removed in 4096e71, 2017-07-18. Some cleanup was done in 861744b, 2020-02-05. To para... — committed to chrisbobbe/zulip-mobile by deleted user 4 years ago
- ios build: Start using CocoaPods again. There was an attempt to use CocoaPods in aded466, 2017-03-19. That was removed in 4096e71, 2017-07-18. Some cleanup was done in 861744b, 2020-02-05. To para... — committed to chrisbobbe/zulip-mobile by deleted user 4 years ago
- ios build: Start using CocoaPods again. There was an attempt to use CocoaPods in aded466, 2017-03-19. That was removed in 4096e71, 2017-07-18. Some cleanup was done in 861744b, 2020-02-05. To para... — committed to chrisbobbe/zulip-mobile by deleted user 4 years ago
- ios build: Start using CocoaPods again. There was an attempt to use CocoaPods in aded466, 2017-03-19. That was removed in 4096e71, 2017-07-18. Some cleanup was done in 861744b, 2020-02-05. To para... — committed to chrisbobbe/zulip-mobile by deleted user 4 years ago
- ios build: Start using CocoaPods again. There was an attempt to use CocoaPods in aded466, 2017-03-19. That was removed in 4096e71, 2017-07-18. Some cleanup was done in 861744b, 2020-02-05. To para... — committed to chrisbobbe/zulip-mobile by deleted user 4 years ago
- ios build: Start using CocoaPods again. There was an attempt to use CocoaPods in aded466, 2017-03-19. That was removed in 4096e71, 2017-07-18. Some cleanup was done in 861744b, 2020-02-05. To para... — committed to chrisbobbe/zulip-mobile by deleted user 4 years ago
- ios build: Start using CocoaPods again. There was an attempt to use CocoaPods in aded466, 2017-03-19. That was removed in 4096e71, 2017-07-18. Some cleanup was done in 861744b, 2020-02-05. To para... — committed to chrisbobbe/zulip-mobile by deleted user 4 years ago
Removing the podfile entry for the lib ( pod ‘RNDeviceInfo’, :path => ‘…/node_modules/react-native-device-info’), and re-linking manually, as described here: https://github.com/react-native-community/react-native-device-info#linking-for-react-native--059-only-react-native--060-skip-this-as-auto-linking-should-work, worked for RN 59.
Yeah, I am still facing the transition: I will reply here if I will find something missing in my configuration. Thanks a lot for your time.
The same issue, is there any updates about how to fix it?
It seems - based on the success of my refresh-example-rn59.sh and the failure of your link-after-pod-init - that you are correct: if using cocoapods with rn59, manually link
but - to make it easy at least, I have moved the Podfile out of the way for certain modules and then run link, then moved it back and that automates everything at least. This should probably be documented 😅 - could you please PR to the install docs mentioning there seems to be a need to work this way, with a link here? 🙏
@rodrigowpl for RN60 you do not need to link. The example is RN60 and I just closed a similar bug #747 please search for dupes first, that one has the info you need
@beeremy I’m looking into doing a refresh-example-rn59.sh script similar to the one I keep current and corresponding examplern59 test app right now, almost have it working. It should work but if it fails that will show the problem.