Thread 1: "*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[2]"
See original GitHub issueBug report

Summary
simulator crashes leading to this error, works fine on physical device
Reproducible sample code
RNFS.downloadFile(options) .promise.then(() => FileViewer.open(localFile, { onDismiss: () => RNFS.unlink(localFile) }) .then(() => console.log('File Success')) .catch(() => console.log('opening file')) ) .catch(() => displayMessage('cannot be viewed', true));
Environment info
npx react-native info output:
System:
OS: macOS 12.0
CPU: (8) x64 Apple M1 Pro
Memory: 39.64 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
Yarn: Not Found
npm: 8.1.4 - ~/.nvm/versions/node/v16.13.1/bin/npm
Watchman: 2021.10.18.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0
Android SDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7784292
Xcode: 13.1/13A1030d - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: ^17.0.2 => 17.0.2
react-native: ^0.66.3 => 0.66.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
library version: 2.1.5
iOS version: 15.0.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:13
Top Results From Across the Web
attempt to insert nil object from objects[1] - Stack Overflow
You are creating a NSDictionary using the shorthand @{ key, value} with one or more nil value. As a preventive technique at the...
Read more >attempt to insert nil object from objects[1] - Bountysource
Hello,. When apple reviews my application and uses photo_manager there is this crash: Fatal Exception: NSInvalidArgumentException ...
Read more >NSPlaceholderDictionary initWithObjects:forKeys:count
NSInvalidArgumentException *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1].
Read more >iOS Question attempt to insert nil object from objects[3]? - B4X
Welcome to B4X forum! B4X is a set of simple and powerful cross platform RAD tools: B4A (free) - Android development · B4J...
Read more >React Native iOS 14 Only attempt to insert nil object from ...
[Answer]-React Native iOS 14 Only attempt to insert nil object from objects[0] ... /bin/zsh Binaries: Node: 10.16.1 - ~/.nvm/versions/node/v10.16.1/bin/node ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I think this is specific to M1 Macs. I noticed the same issue reported for a similar function in a different package: https://github.com/RonRadtke/react-native-blob-util/issues/80
Crashes now on Simulator and iOS device. iOS 15.5