react-native-image-picker: Crash after taking photos with high-end iPhone camera ( > iPhone X )
Bug
When press the shoot button as soon as the camera opens, the app will be terminated with the following native code error. (maybe dual or triple camera)
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: data)'
*** First throw call stack:
Environment info
React native info output:
System:
OS: macOS 10.14.6
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 742.69 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.19.0 - ~/.nvm/versions/node/v10.19.0/bin/node
Yarn: 1.19.2 - /usr/local/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v10.19.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.0, 28.0.1, 28.0.2, 28.0.3, 29.0.0, 29.0.1, 29.0.2
System Images: android-28 | Android TV Intel x86 Atom, android-28 | China version of Wear OS Intel x86 Atom, android-28 | Wear OS Intel x86 Atom, android-28 | Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
Library version: 2.3.0(the latest)
Steps To Reproduce
- launch camera
// Launch Camera:
ImagePicker.launchCamera(options, (response) => {
// Same code as in above section!
});
- press shoot button as soon as camera opens (black photo will be captured)
- app crashes
Describe what you expected to happen:
- The photo info will be passed normally
Reproducible sample code
ImagePicker.launchCamera(options, response => {
// Same code as in above section!
alert(JSON.stringify(response));
});
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (1 by maintainers)
Same issue here, here’s a stack trace from our analytics tool:
Affected devices seem to be: iPhone X iPhone XR iPhone 11 iPhone SE
+1
This is also happening when selecting large photos from the image library on iOS with RN 0.61.5 and latest version of this package 2.3.0
Same error here on iPhone 11.
Same error here on iPhone 11.
+1