How to fix Mach-O file unable to be generated?

I keep getting the error “Mach-o file couldnt be generated” when running the app. Preview only shows the initial hello world before I had pasted in all the files from an Xcode project I saved to the cloud. After restarting, preview is black.

Accepted Reply

After more messing around, I discovered it’s something to do with the pasting of the file directly into the project, potentially even due to moving them into folders right after loading from the cloud. I fixed this error by creating a new file, going to the original project, copying the contents of a file and then going back to playgrounds on the file I had just created and pasting in the entire contents. I did this for all project files. After fixing the errors as they arose per file (simply missing classes of files not yet pasted in) the app worked fine!

Replies

After more messing around, I discovered it’s something to do with the pasting of the file directly into the project, potentially even due to moving them into folders right after loading from the cloud. I fixed this error by creating a new file, going to the original project, copying the contents of a file and then going back to playgrounds on the file I had just created and pasting in the entire contents. I did this for all project files. After fixing the errors as they arose per file (simply missing classes of files not yet pasted in) the app worked fine!