编译我的主目标(不是像here这样的测试目标)会产生此错误:
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
从这个构建命令:
Ld /Build/Products/Debug-iphonesimulator/MyApp.app/MyApp正常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
答案 0 :(得分:79)
缺失的链接:
这个错误几乎总是由于没有链接到库的二进制文件(在这种情况下它将是Crashlytics.framework
):
尝试构建目标MyApp
(其中包含#import <Crashlytics/Crashlytics.h>
标题会产生错误:
ld:警告:提供自动链接 &#39; ../../ Crashlytics.framework / Crashlytics&#39;,框架链接器选项at ../../Crashlytics.framework/Crashlytics不是dylib
链接框架:
幸运的是,只需将
Crashlytics.framework
从项目导航器中的Frameworks
文件夹拖到Link Binary With Libraries
列表或使用+
,就可以轻松解决问题。
答案 1 :(得分:16)
我有同样的问题,但我的理由不同。
ld:警告:在〜/ GameFolder / Pods / Fabric / tvOS / Fabric上自动链接提供的&#39;〜/ GameFolder / Pods / Fabric / tvOS / Fabric.framework / Fabric&#39;,框架链接器选项。 framework / Fabric不是dylib 架构x86_64的未定义符号: &#34; _OBJC_CLASS _ $ _答案&#34;,引自: 在GameScene.o中为__ObjC.Answers键入元数据访问器 在AppDelegate.o中为__ObjC.Answers键入元数据访问器 &#34; _OBJC_CLASS _ $ _ Crashlytics&#34;,引自: 在AppDelegate.o中为__ObjC.Crashlytics键入元数据访问器 &#34; _OBJC_CLASS _ $ _ Fabric&#34;,引自: 在AppDelegate.o中为__ObjC.Fabric键入元数据访问器 ld:找不到架构x86_64的符号 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
OTHER_LDFLAGS
。OTHER_LDFLAGS
更改为继承Linker Flags。基本上,将其更改为$(inherited)
答案 2 :(得分:5)
我按照@ i&#39; L&#39; i提供的所有步骤进行了操作,但我无法在构建阶段找到Crashlytics.framework
和Fabric.framework
文件。
所以这对我有帮助。
第1步:按照Here.
给出的所有步骤操作 第2步:现在,当您点击Crashlytics.framework
时,您无法在Fabric.framework
中找到Link Binary With Libraries
和+
个文件。
2.1:点击+
中的Link Binary With Libraries
按钮
2.2:点击Add Other...
按钮
2.3:现在从Crashlytic.framework
文件夹中选择Fabric.framework
和Pod
- 如果使用cocoapods,则从您下载的位置选择这两个文件。
第3步:构建成功,享受。 :)
答案 3 :(得分:4)
为了将来参考,如果您将测试文件链接到应用目标,也会发生这种情况。
答案 4 :(得分:1)
我遇到了同样的问题。也许我搞砸了最初的结构安装,但是一旦我将Fabric.framework添加到框架列表中(默认情况下应该在应用程序的根文件夹中)一切正常。