What is causing this Crashlytics compile warning? (Auto-Linking supplied '...' framework linker option at '...' is not a dylib)

19,976

Solution 1

The Missing Link:

This error is almost always produced by not having the binary linked to the library (In this case it would be the Crashlytics.framework):

Link Fail

Trying to build the target MyApp (which includes headers with #import <Crashlytics/Crashlytics.h> will produce the error:

ld: warning: Auto-Linking supplied '../../Crashlytics.framework/Crashlytics', framework linker option at ../../Crashlytics.framework/Crashlytics is not a dylib

Link the Framework:

Link Success Fortunately, it should be easy to fix the problem simply by dragging the Crashlytics.framework from the Frameworks folder in the project navigator into the list of Link Binary With Libraries or by using the +.

  • Make sure you have your App selected/highlighted under Targets while doing this process.

enter image description here

Solution 2

I had the same issue but my reason was different.

Error Output

ld: warning: Auto-Linking supplied '~/GameFolder/Pods/Fabric/tvOS/Fabric.framework/Fabric', framework linker option at ~/GameFolder/Pods/Fabric/tvOS/Fabric.framework/Fabric is not a dylib Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_Answers", referenced from: type metadata accessor for __ObjC.Answers in GameScene.o type metadata accessor for __ObjC.Answers in AppDelegate.o "_OBJC_CLASS_$_Crashlytics", referenced from: type metadata accessor for __ObjC.Crashlytics in AppDelegate.o "_OBJC_CLASS_$_Fabric", referenced from: type metadata accessor for __ObjC.Fabric in AppDelegate.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Reason

  • My target was overriding the OTHER_LDFLAGS.

Solution

  • Changed the OTHER_LDFLAGS to just inherit the Linker Flags. Basically, changed it to $(inherited)

Solution 3

I followed all steps provided by @i'L'i but I was not able to find Crashlytics.framework and Fabric.framework file in build phases.

So this helped me.

Step 1: Follow all the steps given Here.

Step 2: Now when you are unable to find Crashlytics.framework and Fabric.framework files in Link Binary With Libraries by clicking + do following.

2.1: Click on + button in Link Binary With Libraries.
2.2: Click on Add Other... button.
2.3: Now chose Crashlytic.framework and Fabric.framework from Pod folder - if using cocoapods, else choose both file from where you have downloaded it.

Step 3: Build Succeeded, Enjoy. :)

Solution 4

For future reference, this can also happen if you link your test files to your app target.

For example: https://github.com/realm/realm-cocoa/issues/1661

Solution 5

I had the same problem. Maybe I messed up the initial fabric install but once I added Fabric.framework to the list of frameworks (should be in the root folder of your app by default) everything worked.

Share:
19,976
Robert
Author by

Robert

iOS Developer

Updated on June 06, 2022

Comments

  • Robert
    Robert about 2 years

    Compiling my main target (not a test target like here) yields this error:

    ld: warning: Auto-Linking supplied 
       '~/Documents/my_app/MyApp/Crashlytics.framework/Crashlytics', 
    framework linker option at 
        ~/Documents/my_app/MyApp/Crashlytics.framework/Crashlytics 
    is not a dylib
    

    From this build command:

    Ld /Build/Products/Debug-iphonesimulator/MyApp.app/MyApp normal i386 cd ~/Documents/my_app/MyApp export IPHONEOS_DEPLOYMENT_TARGET=8.0 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk -L~/Library/Developer/Xcode/DerivedData/MyApp-dbmrsjmskpqxmnegayfzfxgcwvsm/Build/Products/Debug-iphonesimulator -F~/Library/Developer/Xcode/DerivedData/MyApp-dbmrsjmskpqxmnegayfzfxgcwvsm/Build/Products/Debug-iphonesimulator -F~/Documents/my_app/MyApp -filelist ~/Library/Developer/Xcode/DerivedData/MyApp-dbmrsjmskpqxmnegayfzfxgcwvsm/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lPods-CocoaLumberjack -lPods-Mantle -framework CFNetwork -framework Foundation -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.0 -framework CoreGraphics -lPods -framework MapKit -framework Fabric -lPods-MyApp -Xlinker -dependency_info -Xlinker ~/Library/Developer/Xcode/DerivedData/MyApp-dbmrsjmskpqxmnegayfzfxgcwvsm/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp_dependency_info.dat -o ~/Library/Developer/Xcode/DerivedData/MyApp-dbmrsjmskpqxmnegayfzfxgcwvsm/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp

  • phatblat
    phatblat about 9 years
    Nowadays, the Fabric.framework also needs to be linked in the same fashion.
  • AaoIi
    AaoIi almost 8 years
    You have totally saved my wasted days !
  • eiprol
    eiprol over 7 years
    Yeah, this sorted out my problem. Thanks Indeed. PS: I was using cocoapods.
  • xemacobra
    xemacobra over 7 years
    Glad this was helpful.
  • dst3p
    dst3p over 7 years
    +1. I've been having Cocoapods issues for months. Even went as far as completely wiping and restoring my Mac thinking I had messed some other configuration up. This fixed all my issues and I can use cocoapods effectively again! Thank you!
  • Dido
    Dido about 7 years
    Hey, there, I had the exact same issue just recently. I had it with my GGLSignIn from Google and and it was my unit tests that were giving me troubles. So, yeah, the solution was the same but target was MyAppTests, so have that in mind!!
  • anders
    anders almost 7 years
    this was my problem after switching from Carthage to Cocoapods
  • cbowns
    cbowns over 6 years
    Yep, this was my solution. (Fabric was linked by another upstream framework of mine, and was included in the final binary, but the compiler insisted on auto-linking it, and telling me about it.)
  • Max
    Max over 6 years
    This fixed it for me, though in my case the error message was very misleading: the library named in the warning was not the one I had to add! I also was getting undefined symbol errors and the library that defined those symbols was the correct one.