question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App closes after picking a file iOS (Apple M1 Chip)

See original GitHub issue

Bug 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 unknown

Steps to reproduce

  1. Use the latest version of the library on an iOS simulator
  2. Machine has to have an M1 chip

Describe what you expected to happen:

  1. when running via react native run-ios the app will close after picking any file
  2. 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Abhisflyingsooncommented, Apr 19, 2021

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.

Thanks! This is working perfectly.

1reaction
fekajincommented, Apr 13, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found