Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

Attempt to invoke interface method 'void com.facebook.react.bridge.Callback.invoke(java.lang.Object[])' on a null object reference #17

Open
hinciler opened this issue Nov 1, 2019 · 3 comments

Comments

@hinciler
Copy link

hinciler commented Nov 1, 2019

When I add Onfido Sdk for my react native project app crashes when I send the app on back state. I found that error gives because of ActivityEventListener on error callback function, it send nullpointer exception error.

@Bardiamist
Copy link

App not crashing if comment

mErrorCallback.invoke(exception.getMessage());

exception.getMessage():

Unexpected result Intent. It might be a result of incorrect integration, make sure you only pass Onfido intent to handleActivityResult. It might be due to unpredictable crash or error. Please report the problem to android-sdk@onfido.com. Intent: Intent { dat=content://com.android.contacts/contacts/lookup/0r1-343A4C4E50402A4E50/1 flg=0x1 } 
     resultCode: -1

@Bardiamist
Copy link

It can be fixed

if (mErrorCallback != null) {
    mErrorCallback.invoke(exception.getMessage());
}

But why BaseActivityEventListener creating even if I not started Onfido?
Can BaseActivityEventListener be created only on Onfido start and released on Onfido close?

@Bardiamist
Copy link

Steps to reproduce:

  1. yarn add react-native-select-contact
import { selectContact } from 'react-native-select-contact';
selectContact();
  1. Close contacts picker

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

No branches or pull requests

2 participants