App closes after picking a file iOS (Apple M1 Chip)
See original GitHub issueBug report
Summary
When using a machine with M1 chip, running the app on an iOS simulator and picking any file will close the app without any errors on the react native console. I was able to get an error when running the app using xcode
Reproducible sample code
- The app just closes on after picking a file without any errors so I ran the app on xcode and got this error
Steps to reproduce
- Use the latest version of the library on an iOS simulator
- Machine has to have an M1 chip
Describe what you expected to happen:
- when running via react native run-ios the app will close after picking any file
- running with xcode will show the error on the image after picking any file
Environment info
npx react-native info
output:
System:
OS: macOS 11.2.3
CPU: (8) x64 Apple M1
Memory: 124.29 MB / 8.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.11.0 - /usr/local/bin/node
Yarn: Not Found
npm: 7.6.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK: Not Found
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: /undefined - /usr/bin/xcodebuild
Languages:
Java: Not Found
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
library version: 5.0.1
iOS: 14.4
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Crash on MacOS(M1 series): uncaugh… - Apple Developer
Launch the app on a mac; Click in the textfield; Click on the google search bar; The crash should occur. The same issue...
Read more >Fix Apps Crashing on M1 Pro/Max Mac After Migration ...
The solution to fix the app crashing problem is rather straightforward; install Rosetta in macOS again.
Read more >image_picker crashes when picking images on simulator ...
Nope. Apple is doing what apple does best, ignoring the devs. Despite multiple top-voted threads on their forum about this issue, no attention....
Read more >(M1) Mac Keeps Crashing? [Why & How to Fix] 2022
Many users may find Mac crashing or crashing more often after updating to macOS Monterey. That's because the new OS is incompatible with...
Read more >Mac apps keep crashing? Find out why and the fixes!
A simple reboot of your Mac can resolve the app crashing or freezing issues. To restart your Mac computer, click the Apple logo...
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 FreeTop 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
Top GitHub Comments
Thanks! This is working perfectly.
https://developer.apple.com/documentation/coreservices/1448939-uttypecreatepreferredidentifierf according the documentation uti can be null. idk what cause it but on silicon macs its return null and crash.
for now i changed like this:
if (uti) { CFRelease(uti); }
everything is fine on emulator, also on physical device uti isn’t null and CFRelease(uti) works.