Closed jarredt closed 3 years ago
Same error
import { selectContact } from 'react-native-select-contact';
try {
await selectContact();
} catch (error) {
console.log(error.message); // Cannot read property 'openContactSelection' of null
}
@seanadkinson 1.6.2 don't work on iOS
Hmmm, that is very strange. The only commits of any substance in 1.6.x
were this and this. I wouldn't expect either to impact iOS in this way.
It sounds like SelectContact
is simply not available from NativeModules
, based on the errors you both have posted. If you console.log(NativeModules)
on startup, can you confirm SelectContact
is not there?
Can you think of any reasons the same code would work properly on 1.5 and not 1.6, based on the above changes? Did you make sure to pod install
after yarn
?
We moved away from react-native a long time ago, so we aren't currently using this library anymore, so need to rely on the community to diagnose and provide fixes. Thanks!
If you console.log(NativeModules) on startup, can you confirm SelectContact is not there?
'use strict';
import {
Alert,
ActionSheetIOS,
NativeModules,
Platform
} from 'react-native';
console.log({ NativeModules }); // {"NativeModules": {}}
const { SelectContact, ActionSheetAndroid } = NativeModules;
NativeModules is empty object
Can you think of any reasons the same code would work properly on 1.5 and not 1.6, based on the above changes?
I tried this but not helped. So not sure, maybe you changed deploy process.
@seanadkinson I noticed that I tried with wrong podspec file. I edited RCTSelectContact.podspec but now react native using react-native-select-contact.podspe. So I fixed source_files
path in react-native-select-contact.podspec
: https://github.com/streem/react-native-select-contact/pull/46
Also maybe need to delete RCTSelectContact.podspec.
Merged #46, and released 1.6.3
. Can y'all try again to see if the problem is resolved? Thanks!
Yep, looks like this is working for me now. Thanks @Bardiamist and @seanadkinson!
Getting this error on iOS on v1.6.2 when trying to
selectContactEmail
orselectContactPhone
:Confirmed it's working OK on v1.5.0. Deleted
ios/Pods
and reinstalled pods just to be sure.Android seems to be working OK.