f111fei / react-native-unity-view

Show an unity view in react native
MIT License
401 stars 102 forks source link

[android] java.lang.NullPointerException: Attempt to invoke virtual method #72

Closed JanOwiesniak closed 5 years ago

JanOwiesniak commented 5 years ago

I have not found the pattern yet. It seems to be non-deterministic and it's hard to reproduce but it happens from time to time. I'm not even 100% sure this is coming from react-native-unity-view but i though i might put it into an issue anyway. Maybe i'm not the only one running into this :)

2018-11-29 09:10:46.241 31888-31888/com.rnunitydemo E/unknown:ReactNative: Tried to remove non-existent frame callback
2018-11-29 09:10:46.246 31888-32219/com.rnunitydemo E/unknown:ReactNative: Exception in native call
    java.lang.NullPointerException: Attempt to invoke virtual method 'com.facebook.react.bridge.CatalystInstance com.facebook.react.bridge.ReactContext.getCatalystInstance()' on a null object reference
        at com.facebook.react.uimanager.UIManagerHelper.getUIManager(UIManagerHelper.java:28)
        at com.facebook.react.ReactInstanceManager.attachRootViewToInstance(ReactInstanceManager.java:1013)
        at com.facebook.react.ReactInstanceManager.setupReactContext(ReactInstanceManager.java:971)
        at com.facebook.react.ReactInstanceManager.access$1300(ReactInstanceManager.java:116)
        at com.facebook.react.ReactInstanceManager$5$2.run(ReactInstanceManager.java:934)
        at android.os.Handler.handleCallback(Handler.java:898)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:198)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:764)
bpshonyak commented 5 years ago

I'm getting this same error and I don't have react-native-unity-view installed. @JanOwiesniak Are you using react-native-navigation?

Attempt to invoke virtual method 'com.facebook.react.bridge.CatalystInstance com.facebook.react.bridge.ReactContext.getCatalystInstance()' on a null object reference
getUIManager
    UIManagerHelper.java:28
attachRootViewToInstance
    ReactInstanceManager.java:1015
setupReactContext
    ReactInstanceManager.java:974
access$1300
    ReactInstanceManager.java:117
run
    ReactInstanceManager.java:937
handleCallback
    Handler.java:873
dispatchMessage
    Handler.java:99
dispatchMessage
    MessageQueueThreadHandler.java:29
loop
    Looper.java:193
run
    MessageQueueThreadImpl.java:192
run
    Thread.java:764
JanOwiesniak commented 5 years ago

@bpshonyak yes i was using react-native-navigation at this time but meanwhile changed to react-navigation. I have not seen this error in a long time, maybe this issue is related to react-native-navigation and not to react-native-unity-view.