morenoh149 / react-native-contacts

React Native Contacts
MIT License
1.64k stars 560 forks source link

I am facing "Possible Unhandled Promise Rejection (id: 0): " while calling Contacts.getAll() in android. #638

Closed chetan-sharma-newput closed 2 years ago

chetan-sharma-newput commented 3 years ago

Hello there, I am facing Possible Unhandled Promise Rejection (id: 0): TypeError: Cannot convert undefined value to object TypeError: Cannot convert undefined value to object while calling Contacts.getAll() from android device.

const userContacts = await Contacts.getAll() This is how I am calling the method. I tried .then.catch also but no luck. it's urgent.

Note:- I am not facing this issue when I start debugging the app. But when I stop debugging and create a sign-in build of the app then I face this issue.

Screenshot 2021-09-06 at 9 26 13 PM
vincentzierigen commented 3 years ago

Having the same issue

chetan-sharma-newput commented 2 years ago

Having the same issue

Hello, after that issue I debug my code. In the code, I was replacing some strings and calling string.replaceAll() method but later i found there is no method in react-native called replaceAll(). RN only provide replace() method. Thanks.