I just tried to run an application on my iPad and got this error:
ld: file too small (length=0) file '(PathToMyProjectBuild)/Objects-normal/arm64/Palette.o' for architecture arm64
clang: error: linker command failed with exit code 1
My app runs great on iPhone and was gracefully running on my iPad, then suddenly I got this. What does it even mean and how can I solve the issue, since I am developing this app to mainly use it on my iPad, not iPhone (Though it is universal)?
This error happens after you interrupted a build. Product/Clean will usually fix it.
I believe the compiler is trying to save binary data in a file/space that was partially allocated (and not cleaned up) by the interrupted build but the new binary data is larger than the previous one which is likely a zero-byte file.
Sometimes cleaning the project is not the best option because it takes long time to recompile everything from scratch. Most of the time there is only a single (in rare cases 2 or 3) file that produces the error.
To fix the issue simply remove that exact file from terminal and re-build by pasting the full path after rm
command. In your case it would be:
$ rm (PathToMyProjectBuild)/Objects-normal/arm64/Palette.o
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With