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.

Exception in HostObject::get(propName:RNDeviceInfo): <unknown>

See original GitHub issue

Summary

Version 8.1.3
Affected OS iOS
OS Version 14.5

Current behavior

On startup, the app is crashing and displays this error message:

When we remove the lib, everything works fine. We already tried to delete and reinstall node_modules, reinstall Pods, it’s not working.

Below, the code that generates the error:

 if (DeviceInfo.hasNotch()) {
    // in case the notch returns undefined I put
    // a default value that I calculated on an iphone 12
    statusBar = StatusBar.currentHeight || 65;
  }

Expected behavior

We should be able to know if the current device has, or not, a notch. The function returns a boolean.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

2reactions
stevem21mcommented, Aug 24, 2022

Like @sandergo90 said, my project did not have a version number. Once I added a version number (Target > General > Identity > Version) it worked. Thanks

1reaction
sandergo90commented, Sep 1, 2021

I’ve had the same problem in a new react native project. Best advise I can give is to check if any variable that’s declared in your Info.plist, is also declared in your project.pbxproj file. For me for example, the string ${MARKETING_VERSION} dit not exist in my project.pbxproj file because I deleted the short version string of my app in Xcode. So when leaving the version empty, react-native-device-info will crash because it tries to fetch a null value.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

[JitsiMeetSDK] Error: Exception in HostObject::get(propName ...
Every time when I'm joining the room I get this error message and only a black screen appears.. I'm using the latest release...
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