ld: truncated fat file

I had a similar error on one of my project:

ld: truncated fat file. Slice from 1067056 to 2127456 is past end of file with length 770048 file '/Users/jenkins-slave-pepper/workspace/iosbuild/App/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/FirebaseInstanceID' for architecture armv7

The solution was to clear the pod cache and re-download everything.

rm -rf ~/Library/Caches/CocoaPods
rm -rf `pwd`/Pods/
pod update

Try to made following changes in your project:-

  • Include all necessary frameworks in the link phase
  • Remove -all_load from Other Linker Flags.
  • Clean the build folder and re-compiled from scratch.

This could very well be a permission issue, a corrupt iOS SDK install, or a corrupt Xcode install. I would remove /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulatorXXX.sdk, then go into Xcode > Preferences > Downloads and reinstall the iOS SDK. Then try again to clean and build your project. If you still have problems, I would consider reinstalling Xcode again.

Also have a look how to fix xcode path problems.