I am working on a React Native app and I need to save a new Contact into the phone. Doing a research I found out that there are 3 libraries which implements that functionality: expo-contacts, react-native-contacts and react-native-unified-contacts. In each one I followed the installation instructions, but in each one of them I keep having the sames errors:
Possible Unhandled Promise Rejection (id: 0):
TypeError: null is not an object (evaluating '_reactNativeUnifiedContacts.default.getContacts')
http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:150346:52
tryCallOne@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:27023:16
http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:27124:27
_callTimer@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:30578:17
_callImmediatesPass@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:30614:19
callImmediates@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:30833:33
callImmediates@[native code]
__callImmediates@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:2625:35
http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:2402:34
__guard@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:2608:15
flushedQueue@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:2401:21
flushedQueue@[native code]
invokeCallbackAndReturnFlushedQueue@[native code]
This exactly error is from the react-native-unified-contacts, but all of them throws a "null is not an object" error. Firstly, I though it could be a linking problem, but as I have React Native 0.61 version, the linking is automatically done. So, I keep having this errors and I can't add any contact.