Open kw2019ltd opened 4 years ago
Is this ios? Android? And does it happen every time? Or just sometimes?
I am getting the same error, I am providing display name, family name and phones
I haven't tested the behavior, but I don't think you should be providing an identifier
- I believe that should be set by the underlying framework. What happens if you remove the identifier
field?
Issue still happens. Please fix it
await Contacts.addContact(Contact(givenName: 'HHH', displayName: 'dd'));
PlatformException (PlatformException(notFound, in method getContact: Expected a single result for contact ContactKeys(mode=UNIFIED, unifiedContactId=220335, singleContactId=null, lookupKey=null), but instead found 0, co.sunnyapp.flutter_contact.MethodCallException: notFound: in method getContact: Expected a single result for contact ContactKeys(mode=UNIFIED, unifiedContactId=220335, singleContactId=null, lookupKey=null), but instead found 0, null))
Temp fix is to just put it in try catch but not handle the error
trying to add Contact using Contacts.addContact(contact); using flutter_contact: ^0.6.4
getting below error but contact is being added see below screen pls fix it
{identifier: 234234, displayName: dd, givenName: HHH, middleName: null, familyName: null, lastModified: null, unifiedContactId: null, singleContactId: null, otherKeys: {}, prefix: null, suffix: null, company: null, jobTitle: null, emails: [], phones: [], dates: [], socialProfiles: [], urls: [], postalAddresses: [], avatar: null, note: null}
I/flutter ( 5100): ══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════ I/flutter ( 5100): The following PlatformException was thrown: I/flutter ( 5100): PlatformException(notFound, in method getContact: Expected a single result for contact I/flutter ( 5100): ContactKeys(mode=UNIFIED, unifiedContactId=1226, singleContactId=null, lookupKey=null), but instead I/flutter ( 5100): found 0, co.sunnyapp.flutter_contact.MethodCallException: notFound: in method getContact: Expected a I/flutter ( 5100): single result for contact ContactKeys(mode=UNIFIED, unifiedContactId=1226, singleContactId=null, I/flutter ( 5100): lookupKey=null), but instead found 0)