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

Error: Exception in HostObject::get(propName:JailMonkey): java.lang.NullPointerException #76

Open
sahil290791 opened this issue Nov 29, 2020 · 7 comments

Comments

@sahil290791
Copy link

jail-monkey version: 2.3.2
RN: 0.61.5

Setup:
android/app/build.gradle:

dependencies {
   ....
   ....
   ....
    implementation project(':jail-monkey')
    implementation project(':react-native-branch')
   ....

settings.build.gradle

include ':jail-monkey'
project(':jail-monkey').projectDir = new File(rootProject.projectDir, '../node_modules/jail-monkey/android')

I am getting this error in some of the android devices (Samsung note 20 Ultra):

com.facebook.react.common.JavascriptException: Error: Exception in HostObject::get(propName:JailMonkey): java.lang.NullPointerException, stack:
<unknown>@1788:122
v@2:1474
<unknown>@1785:349
v@2:1474
<unknown>@386:200
v@2:1474
<unknown>@6:58
v@2:1474
d@2:876
global code@3823:4

at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java
  at java.lang.reflect.Method.invoke (Method.java)
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:371)
  at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:150)
  at com.facebook.react.bridge.queue.NativeRunnable.run (NativeRunnable.java)
  at android.os.Handler.handleCallback (Handler.java:938)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:26)
  at android.os.Looper.loop (Looper.java:246)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:225)
  at java.lang.Thread.run (Thread.java:923)

Can you please help on what might be wrong here?

@sahil290791 sahil290791 changed the title com.facebook.react.common.JavascriptException: Error: Exception in HostObject::get(propName:JailMonkey): java.lang.NullPointerException, stack: Error: Exception in HostObject::get(propName:JailMonkey): java.lang.NullPointerException Nov 29, 2020
@bohdansushchak
Copy link

bohdansushchak commented Jan 4, 2021

I have the same issue
"jail-monkey": "^2.3.3",
"react-native": "0.61.5",

Samsung Galaxy Note9, Android 10
Samsung Galaxy S9+, Android 10

@hwq0521
Copy link

hwq0521 commented Jan 5, 2021

I have the same issue
"jail-monkey": "^2.3.2",
"react-native": "0.61.5",

Galaxy Note10+, Android 10
Galaxy Note9, Android 10
Galaxy S20+, Android 11

@nzankich
Copy link

nzankich commented Feb 9, 2021

Getting this issue as well. It seems to be exclusive to Samsung devices.

It comes in as
Exception in HostObject::get(propName:JailMonkey): java.lang.NullPointerException: Attempt to get length of null array
sometimes as well

@nzankich
Copy link

nzankich commented Feb 9, 2021

my team only uses the mocked location and rooted check so it must be from one of those. If I had to guess it's coming from the mocked location check here:

                    pm.getInstalledApplications(PackageManager.GET_META_DATA);

Android docs say that it can't come back as null
https://developer.android.com/reference/android/content/pm/PackageManager#getInstalledApplications(int)

BUT I do see some cases online where people say it's coming back as null if permission settings are wrong. it's just a guess though. Almost everything else in there is covered by try/catches

@mountainfirefly
Copy link

@nzankich If at the android side it is coming as null, does it mean it is not a rooted device?

@nzankich
Copy link

@mountainfirefly if anything it would be the opposite. maybe the rooted device is disrupting/blocking that check?

I don't think there is any correlation though. I think Samsung devices have a bug/are just doing something against Android specs

@pke
Copy link

pke commented May 12, 2022

Had this problem today too and came here via google. Samsung device. Any idea what could cause it?
Could be our JM version is too old, this seems to have been fixed in 2.6.0
2492b47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants