react-native-image-picker: {"errorCode": "others"} and undefined errorDescription
Discussed in https://github.com/react-native-image-picker/react-native-image-picker/discussions/1993
<div type='discussions-op-text'>Originally posted by PDipendra June 22, 2022 Works fine in android simulator and device, but throw {“errorCode”: “others”} and empty errorDescription in iOS 14.5 and 15.5.
await launchImageLibrary(
{
mediaType: 'video',
},
response => {
console.log(response);
}
);
```</div>
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 18
- Comments: 21 (1 by maintainers)
This appears to only be an issue on iOS simulator, and also probably only on M1 Macs, related to this issue: https://github.com/react-native-image-picker/react-native-image-picker/issues/1999
However, using an iOS hardware device via Xcode when running with local RN apps does allow video uploads, so is most likely just a symptom of iOS Simulator + M1 Macs
Same issue on real devices in production, “.WEBP” might be the issue like @KelvinPortuphy says
I have the same issue:
“react-native-image-picker”: “^4.10.2” “react-native”: “0.70.6”,
Apple M1 Version 13.3 (22E252)
iPhone 14 - iOS 16.1 Xcode Version 14.1 (14B47b)
I get the error: {“errorCode”: “others”} errorMessage undefine
https://user-images.githubusercontent.com/73840306/230504737-0f2f45c2-b87d-49ce-9dee-19b376fdf3d5.mp4
Updating Xcode to version 14.2 helped me fix a similar problem. (M1)
Also, now that I tested even more, I realized this is easily replicable if you take 2 photos with one of them being “RAW”.
The non-RAW photo will be picked up normally and the RAW one will throw the error described above.
Did some more digging and I think this has to do with image of type “.WEBP”
Here’s an easy repro (simulator and real devices) :
With safari go to this page : https://www.carrefour.fr/p/lentilles-carrefour-classic-3560070329441 Save the photo directly on the page and try to use it with react-native-image-picker, it will fail.
Strangely if you open and display directly the photo url in safari and save it will be fine ti use with image-picker.
video : https://imgur.com/a/umBRz3J
Note : only the second photo is available to download, when I plug my iPhone on my Mac, in Apple Photos app.