TypeError: Cannot read property 'getAll' of null
React Native : 0.77.1
Package version is "react-native-contacts": "^8.0.4",
This issues only with android platform, ios is working fine.
Object is there, but when try to call getAll or any other methis it return error in android platform
I am also getting the same issue. Also downgraded the version still the issue is persistent.
@sr-sameer you can use https://www.npmjs.com/package/@s77rt/react-native-contacts package
@sr-sameer you can use https://www.npmjs.com/package/@s77rt/react-native-contacts package
Thanks! For now, what I did is import Contacts from react-native-contacts/src/NativeContacts instead of react-native-contacts because I don't know why the condition in node_modules/react-native-contacts/index.ts is failing. The condition is:
const isTurboModuleEnabled = global.__turboModuleProxy != null;
The issue is that global.__turboModuleProxy is undefined. Since I'm new to React Native, I don't know the actual fix for this.
I directly imported the NativeContacts
Same issue on new arch.
@sr-sameer Your fix worked, however, this issue came with the react native new architecture. since new rn projects have the new arch enabled by default, you might encounter some issues with other react native libraries due to this new arch.
@sr-sameer you can use https://www.npmjs.com/package/@s77rt/react-native-contacts package
Thanks! For now, what I did is import Contacts from react-native-contacts/src/NativeContacts instead of react-native-contacts because I don't know why the condition in node_modules/react-native-contacts/index.ts is failing. The condition is:
const isTurboModuleEnabled = global.__turboModuleProxy != null;
The issue is that global.__turboModuleProxy is undefined. Since I'm new to React Native, I don't know the actual fix for this.
I directly imported the NativeContacts
@sr-sameer Your fix worked for me. Thanks
I think we fixed it with this patch https://github.com/morenoh149/react-native-contacts/commit/d927fecbc06465f67180dd5b7b2b52296c5808c3
Still not fixed @morenoh149 on version 8.0.5
Tested on IOS only for now
Error fetching contacts: TypeError: 0, _$$_REQUIRE(_dependencyMap[12(...) "react-native-contacts").getAll is not a function (it is undefined)
RN version 0.79.0 using the new arch.
Hello,
I'm having the same issue with React Native 0.77.2. Any update on this bug ?
Thanks
Someone find a fix on Reddit : changing the import.
import Contacts from "react-native-contacts/src/NativeContacts"
https://www.reddit.com/r/reactnative/comments/1kdoy4a/comment/mqcvq19/?tl=fr&utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
For me, both
const Contacts = NativeModules.Contacts ?? NativeContacts;
and
import Contacts from "react-native-contacts/src/NativeContacts"
works . . thanks
any news here?? i tried the import Contacts from "react-native-contacts/src/NativeContacts" but to no success
only on android
This issue is stale, please provide more information about the status
No fix comming, so I choose the expo one solution and migrate.
Hope a fix is coming since this is the only solid contacts module for bare projects.