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.

NativeModule.RNDeviceInfo is null on iOS 10.x (works on iOS 13.x)

See original GitHub issue

Bug

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

  1. Run an app using react-native-device-info on iOS 13
  2. Notice it working
  3. Run an app using react-native-device-info on iOS 10
  4. See the error

Describe what you expected to happen:

  1. 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:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

8reactions
mikehardycommented, Nov 23, 2019

react-native-clean-project, the silver bullet cure for iOS build woes from @pmadruga 😃, spread the word to anyone else suffering 💪

2reactions
mikehardycommented, Nov 22, 2019

“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)

Read more comments on GitHub >

github_iconTop 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 >

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