NativeModule.RNDeviceInfo is null on iOS 10.x (works on iOS 13.x)
See original GitHub issueBug
Getting the following error when running our app in the simulator for iOS 10.3.1:
@react-native-community/react-native-device-info: NativeModule.RNDeviceInfo is null.
On iOS 13.2.2 it works.
I’ve cleaned out the build and ran pod install
again. Also, just switching targets between my “iPhone 5 (iOS 10.3.1)” and “iPhone 11 Pro (iOS 13.2.2)” makes it work/not work.
Environment info
React native info output:
$ react-native info
info Fetching system and libraries information...
System:
OS: macOS 10.15.1
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Memory: 294.21 MB / 32.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.12.0 - /usr/local/bin/node
Yarn: 1.19.1 - node_modules/.bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.4 => 0.61.4
Library version: 5.3.1
Steps To Reproduce
- Run an app using react-native-device-info on iOS 13
- Notice it working
- Run an app using react-native-device-info on iOS 10
- See the error
Describe what you expected to happen:
- It work on every iOS version between 9.0 and 13.2
Reproducible sample code
import DeviceInfo from 'react-native-device-info'
console.log(DeviceInfo.getBundleId())
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
NativeModule.RNDeviceInfo is null on iOS 10.x (works on iOS ...
Getting the following error when running our app in the simulator for iOS 10.3.1: @react-native-community/react-native-device-info: NativeModule ...
Read more >NativeModule.RNDeviceInfo is null. To fix this issue these ...
Try running the command. react-native link react-native-device-info. or. cd ios && pod install && cd .. Then try running your project again ...
Read more >In test ONLY: @react-native-community/react-native-device-info
RNDeviceInfo is null. ... 08 July 2019 Posted by emclab ... But the tricky is that my app works fine when launching with...
Read more >react-native-device-info - UNPKG
18, Platform.OS === 'dom' ; 19, ) { ; 20, throw new Error(`@react-native-community/react-native-device-info: NativeModule.RNDeviceInfo is null. To fix this issue ...
Read more >react-native-device-info - npm
Gets the device model. iOS warning: The list with device names is maintained by the community and could lag new devices. It is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
react-native-clean-project, the silver bullet cure for iOS build woes from @pmadruga 😃, spread the word to anyone else suffering 💪
“you have cleaned out the build” ->
npx react-native-clean-project clean-project-auto
and try again - let me know if you still see it? (hypothesis: stale DerivedData)