Getting undefined is not an object: reactNativeDeviceInfo.DeviceInfo.getAPILevel is
See original GitHub issueSummary
I have recently upgraded to RN: 0.45.1, react-native-device-info: 0.15.1, and whenever I try to query for api level the app crashes with an error.
Version | 0.15.1 |
Affected OS | Android |
OS Version | 8.0.0 |
Current behavior
Getting this error in sentry:
undefined is not an object (evaluating 'reactNativeDeviceInfo.DeviceInfo.getAPILevel')
This was working in previous version of RN 44.0 and react-native-device-info: 0.13.0
Expected behavior
getAPILevel should give the api level
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Getting undefined is not an object: reactNativeDeviceInfo ...
Summary I have recently upgraded to RN: 0.45.1, react-native-device-info: 0.15.1, and whenever I try to query for api level the app crashes ...
Read more >undefined is not object (evaluating 'RNDeviceInfo.deviceId')
I am using react-native-device-info library, and it works fine for iOS simulator. But for ...
Read more >react-native-device-info - npm
If there is no implementation for a platform, then the "default" return values you will receive are "unknown" for string, -1 for number,...
Read more >Example to Get Device Information in React Native
This is an example to Get Device Information in React Native. To get the device information in React Native will use the react-native-device-info...
Read more >How to use the react-native-device-info.getDeviceLocale ...
To help you get started, we've selected a few react-native-device-info.getDeviceLocale examples, based on popular ways it is used in public projects.
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 @machour , sorry I noticed that as it was working in other components of my app, in one particular component i was importing it in an incorrect way:
Hi @sahil290791, it seems like you forgot to link the library. Can you try
react-native link react-native-device-info
?