Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in HostObject::get: <unknown> #48

Closed
donovanhiland opened this issue Apr 16, 2019 · 14 comments
Closed

Exception in HostObject::get: <unknown> #48

donovanhiland opened this issue Apr 16, 2019 · 14 comments
Labels
bug Something isn't working

Comments

@donovanhiland
Copy link

Describe your environment

  • react-native-localize 1.0.3
  • react-native 0.59.3
  • Target platform: Android
  • Device:
    • Manufacturer: Tecno, OS: 7.0
    • Manufacturer: Infinix, OS: 7.0 or 8.1.0
    • Manufacturer: OnePlus, OS: 9.0
    • Manufacturer: Pixel, OS: 9.0
  • OS: 7, 8, 8.1 ,9
  • DevTools: N/A
  • buildToolsVersion: 28.0.3

How to repeat issue and example

import { findBestAvailableLanguage } from 'react-native-localize'

expected it not to crash but it crashes on the above devices with:

Exception in HostObject::get: <unknown>

Some context around this error: This does not happen very often. Probably something like 1% of the time but it does result in an unrecoverable crash we think. We're seeing this reported through bugsnag and we don't have a device to reproduce this on. Thought it would be worth a report anyway. Maybe you all have some context on this error.

@zoontek
Copy link
Owner

zoontek commented Apr 20, 2019

@donovanhiland Do you have a more complete Stacktrace?

@DimitryDushkin
Copy link

Might be related facebook/react-native#24607

@zoontek
Copy link
Owner

zoontek commented May 4, 2019

@DimitryDushkin So it seems that getting a constant on this devices results sometimes in a crash. We have to find which one.

@DimitryDushkin
Copy link

Yeah, in our case some of constants turned out to return nil instead of NSString.

@gbalduzzi
Copy link

Are there some workaround for this issue? I'm still experiencing it and I honestly don't know how to fix it

@mr-ryan-james

This comment has been minimized.

@zoontek
Copy link
Owner

zoontek commented Sep 3, 2019

@gbalduzzi Please provides some details (OS version, RN version, simulator / phone), etc. As I don't even know how to reproduce the error, it's very hard to find the cause 😞

I will add some guards on every functions, but it would be better to identify where the problem is.

@gbalduzzi
Copy link

I managed to reproduce the error by adding in my phone languages the en_XA locale (called [Pseudo locale]

@zoontek
Copy link
Owner

zoontek commented Sep 3, 2019

@gbalduzzi On which Android version / phone / simulator?

@gbalduzzi
Copy link

I tested on a Huawei P20 Lite with android 8.0.0, but it also occurred in a OnePlus 3T with Android 9. I got the feeling that it's more about some locales than about some specifics phone/android versions

@zoontek
Copy link
Owner

zoontek commented Sep 3, 2019

@gbalduzzi Thanks! It can be enough to reproduce the error and investigate 🙂

@gbalduzzi
Copy link

gbalduzzi commented Sep 3, 2019

Sharing some more info I collected while testing:

  • Removing the call to findBestAvailableLanguage resolved the problem on the library
  • Other libraries share the same issue: every call to react-native-device-info will result in the same error
  • Even having the pseudo locale as second or third language will result in an error
  • It seems to fail while parsing the locale currency

@zoontek
Copy link
Owner

zoontek commented Sep 3, 2019

@gbalduzzi Which version of the library are you using? A fix for this issue has been released in version 1.0.4: #38 (it might not works in every cases)

@zoontek
Copy link
Owner

zoontek commented Sep 10, 2019

@gbalduzzi I made a new release (1.2.0) with fallbacks for unknown countries / currencies.

Screenshot_20190910-152103

@zoontek zoontek added the bug Something isn't working label Sep 10, 2019
@zoontek zoontek closed this as completed Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants