-
Notifications
You must be signed in to change notification settings - Fork 238
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 for prop 'RNCGeolocation': java.lang.NullPointerException: Null context is not permitted., js engine: hermes #206
Comments
Could you provide me with more detailed environment info, or ideally with a minimal repro project? |
I'm having the same issue and am unable to figure out the root cause. I'm on react-native 0.70.2. All I did was upgrade from react-native-geolocation v2.1.0 to v3 (tried 3.0.0, 3.0.1, and 3.0.2) and seeing this crash. It appears to only show up in Android Release mode. I'm not seeing any issues on iOS (debug or release) or Android (debug). It was not noticed until deployed for distribution, but I am also able to detect it in the emulator if I change it to release. No other code changes were made and if I download back to v2.1.0 the error goes away. Fatal Exception: com.facebook.react.common.JavascriptException: Error: Exception in HostObject::get for prop 'RNCGeolocation': java.lang.NullPointerException: Null context is not permitted., js engine: hermes, stack:
|
HI @michalchudziak. This appears to be caused when Hermes is enabled. I took a look at your example and it Hermes is set to false and the new architecture is set to true. My project has Hermes set to true and the new architecture set to false. I disabled Hermes and the app was able to launch successfully. |
That's a good lead, I will test it out today. Thanks |
I just tried out the example app with Hermes enabled and I can't reproduce the issue. Could you provide me with a minimal repro project? I will be happy to fix the issue as soon as I'm able to reproduce it. |
Also, more info about the affected devices/build flavor, etc will be helpful. |
Let me see if I can figure out what is different between my solution and your example. I'll do some more troubleshooting and get back to you. |
@michalchudziak. I was able to reproduce this issue with a clean install by following the following steps. 1. Create new react-native app 2. Install geolocation module within new app 3. Add geolocation import to default 'App.js' file 4. Run using Build Variant 'release' (not debug) Every time you attempt to launch the app, it crashes every time. |
@jplandry908 Can you tell me which device you use? I followed these steps on the Pixel emulator & physical Samsung S10 and everything works well. Maybe it's specific to some group of devices? |
Hi @michalchudziak. How strange. I was able to reproduce the crash on every emulator I tried. Pixel 5 (API 31), Pixel 4 (API 29), & Pixel 3 (API 30) are some examples. Also, when I only update this module on my production app, it works fine in iOS and Android DEBUG locally but if I test on the release variant it fails. I detected this (since I rarely change my local variant to release) when I pushed it to Google Play store and it failed all 10 of their random tests using random devices. Let me package up my test project for you. @petrlz63 - Yo you have any other information? It sounds like you are experiencing the same issue when trying to upgrade your app. UPDATE: This link will be valid for 48 hours. It was built using the steps outlined above. I also removed the IOS folder to reduce the size. |
@jplandry908 Thank you a lot, I'm able to reproduce and fix the issue. I'll ship the new version soon :) |
Fixed in 3.0.3 release |
Thanks @michalchudziak. I can confirm that the issue appears to have been fixed in the v3.0.3 release. I appreciate your support! |
Environment
production
Platforms
Android
Versions
Description
After update react-native-geolocation to 3 (tried all 3.x versions) we are getting this error on multiple android devices:
Error: Exception in HostObject::get for prop 'RNCGeolocation': java.lang.NullPointerException: Null context is not permitted., js engine: hermes
Reproducible Demo
Sadly we can't reproduce it on our own test devices :/
The text was updated successfully, but these errors were encountered: