Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my app suddenly not build and complain about these "ld" and "clang" errors?

These errors are really confusing me, and I have no idea what I did to trigger them:

ld: warning: directory not found for option '-F/"..."'
ld: warning: ignoring file "..."/iOS 7/Crashlytics.framework/Crashlytics, file was built for unsupported file format ( 0x56 0x65 0x72 0x73 0x69 0x6F 0x6E 0x73 0x2F 0x43 0x75 0x72 0x72 0x65 0x6E 0x74 ) which is not the architecture being linked (i386): /"..."/Crashlytics.framework/Crashlytics
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_Crashlytics", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I haven't a sweet clue what it is talking about. How do I fix it?

like image 954
Doug Smith Avatar asked Jan 06 '14 02:01

Doug Smith


2 Answers

From Crashlytics support:

  1. Trash Crashlytics.framework from your project.

  2. Run this in the terminal to copy the framework to your desktop:

ditto -xk /Applications/Fabric.app/Contents/Resources/com.crashlytics.sdk.ios-default.zip ~/Desktop/

  1. Add & copy the framework back into your project.
like image 56
capikaw Avatar answered Oct 23 '22 00:10

capikaw


I was using Crashlytics with cocoapods and confronted the same error after upgrading to Fabric.

Steps to fix:

  1. Delete "Other linker flags" and paste $(inherited) in it
  2. Delete "Other librarian flags" and paste $(OTHER_LDFLAGS)
  3. Delete Crashlytics.framework from the Pods directory
  4. Run pod install. You will see something like this in the "./Pods/Fabric/Crashlytics.framework/Versions/A/Resources/info.plist

enter image description here

like image 27
Tim Avatar answered Oct 23 '22 01:10

Tim