Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode, Swift (Domain = NSPOSIXErrorDomain, Code = 22)

My friend came to me with a small request of creating a video portfolio app. I thought it was a good excuse to try out Swift, which is what I did. (The app is not intended for release on the app store, only to distribute via Testflight)

I've run into some trouble where I'm getting the following error when trying to run my project:

An error was encountered while running (Domain = NSPOSIXErrorDomain, Code = 22)

The error appeared after adding a directory with .mp4 video files to my project in my "Bundle Resources". It concerns 6 .mp4 files at around 1.2gb in total.

As I couldn't figure out why the error happened in the first place, I decided to re-do my entire project (copying over bits and pieces). The project ran just until the part where I added the folder containing the videos.

I've tried removing both the reference and the folder, but the error consist. I really want to get to the bottom of this, so that I instead of having to create a new project, I can just remove whatever files are creating the problem.

Thanks in advance.

like image 831
dnlmzw Avatar asked Sep 14 '14 16:09

dnlmzw


2 Answers

In my case, I had created the directory "Resources" absentmindedly and added it as a reference to my project. Renaming this folder, cleaning the project, and deleting the derived data (~/Library/Developer/Xcode/DerivedData/) fixed it for me.

like image 120
Mike Sprague Avatar answered Sep 18 '22 09:09

Mike Sprague


Check infoplist file under TARGETS -> General - > Identity.

Please add the new infoplist file if missing in project folder. For new info plist values you can create new dummy project and copy, rename the infoplist file from there.

like image 32
Ashish Sharma Avatar answered Sep 19 '22 09:09

Ashish Sharma