RNDeviceInfo is null issue on react-native 0.60.4
See original GitHub issueBug
RNDeviceInfo is null issue on react-native 0.60.4. Importing it fails with version 2.3.2.
Environment info
React native info output:
System:
OS: macOS 10.14.5
CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
Memory: 13.90 GB / 32.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.8.0 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.10.3 - /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: 28
Build Tools: 28.0.2
System Images: android-28 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.1 AI-173.4907809
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.4 => 0.60.4
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
Library version: x.x.x
Steps To Reproduce
- Create a new app react-native init MyTestApp
- In App.js, import DeviceInfo:
import DeviceInfo from 'react-native-device-info';
- npm install it:
npm install react-native-device-info --save
- Run with react-native run-ios
Describe what you expected to happen:
- I would expect the app to start normally.
- To be coherent, I would have expected react-native-device-info to be installed in ./node_modules/@react-native-community/react-native-device-info. Rather it’s installed in ./node_modules/react-native-device-info
Reproducible sample code
The app created by init is sufficient after importing DeviceInfo in App.js.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
NativeModule.RNDeviceInfo is null - Stack Overflow
I'm trying to use react-native-device-info (8.7.0) to get some device information on an Android React Native application (RN version 0.60.5) ...
Read more >NativeModule.RNDeviceInfo is NULL - Expo Development Tools
I am trying to use 'react-native-device-info' libary, but I take this error: ... RNDeviceInfo is NULL on RN 0.59.8 (Expo SDK 34).
Read more >react-native-device-info - UNPKG
20, throw new Error(`@react-native-community/react-native-device-info: NativeModule.RNDeviceInfo is null. To fix this issue try these steps:.
Read more >react-native-device-info - npm
Method Return Type iOS Android Windows Web
getAndroidId() Promise ❌ ✓ ❌ ❌
getApiLevel() Promise ❌ ✓ ❌ ❌
getApplicationName() string ✓ ✓ ✓ ❌
Read more >Upgrading a React Native app from 0.60 to 0.65 - YouTube
Jamon attempts to upgrade a React Native app from 0.60 to 0.65 with ... mixed results. -- Watch live at https://www.twitch.tv/jamonholmgren.
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
Thanks for the feedback! Cheers! PR? Not sure what that is…
-Patrice
On Thu, Aug 8, 2019 at 5:57 PM Mike Hardy notifications@github.com wrote:
@mikehardy You’re right. I’ve missed out some part during the RN 0.60 upgrading process. Thanks for pointing that out.