react-native-contacts icon indicating copy to clipboard operation
react-native-contacts copied to clipboard

Crash app when using writePhotoToPath in Android

Open LucasWilliams2622 opened this issue 5 months ago • 0 comments

I used the function writePhotoToPath to update avatar of the contact but i got this error Screenshot 2024-09-14 at 21 26 01

here is my code:

 await Contacts.writePhotoToPath(
          updatedContactPartial.recordID,
          updatedData.avatar.uri,
        );

updatedContactPartial.recordID is a id in contact list updatedData.avatar.uri is file:///data/user/0/com.myappname/cache/12787931-c614-4812-bd88-09cba908e878.JPEG

the full file image:

{"name": "12787931-c614-4812-bd88-09cba908e878.JPEG", "type": "image/jpeg", "uri": "file:///data/user/0/com.myappname/cache/12787931-c614-4812-bd88-09cba908e878.JPEG"}

LucasWilliams2622 avatar Sep 14 '24 14:09 LucasWilliams2622