Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"File too small for architecture arm64", "clang: error: linker command failed with exit code 1 "

Tags:

xcode

ios

ipad

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)?

like image 793
EBDOKUM Avatar asked Jan 11 '16 17:01

EBDOKUM


2 Answers

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.

like image 101
Alain T. Avatar answered Oct 04 '22 04:10

Alain T.


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
like image 33
Vytis Avatar answered Oct 04 '22 04:10

Vytis