编译我的主目标(不是像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 -Xl inker -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的
6 回答
The Missing Link:
这个错误几乎总是由于没有链接到库的二进制文件(在这种情况下它将是
Crashlytics.framework
):尝试构建目标
MyApp
(其中包含带#import <Crashlytics/Crashlytics.h>
的标头将产生错误:Link the Framework:
幸运的是,只需将
Crashlytics.framework
从项目导航器中的Frameworks
文件夹拖到Link Binary With Libraries
列表中或使用+
,就可以轻松解决问题 .我有同样的问题,但我的理由不同 .
错误输出
原因
OTHER_LDFLAGS
.解决方案
OTHER_LDFLAGS
更改为仅继承链接器标志 . 基本上,改为$(inherited)
我按照@i 'L'提供的所有步骤进行了操作,但是我无法在构建阶段找到
Crashlytics.framework
和Fabric.framework
文件 .所以这对我有所帮助 .
Step 1: 按照给出的所有步骤Here.
Step 2: 现在,当您无法通过单击
+
找到Link Binary With Libraries
中的Crashlytics.framework
和Fabric.framework
文件时,请执行以下操作 .2.1: 单击
Link Binary With Libraries
中的+
按钮 .2.2: 单击
Add Other...
按钮 .2.3: 现在从
Pod
文件夹中选择Crashlytic.framework
和Fabric.framework
- 如果使用cocoapods,则从下载文件中选择两个文件 .Step 3: Build 成功,享受 . :)
为了将来参考,如果您将测试文件链接到应用目标,也会发生这种情况 .
例如:https://github.com/realm/realm-cocoa/issues/1661
我有同样的问题 . 也许我搞砸了最初的结构安装,但是一旦我将Fabric.framework添加到框架列表中(默认情况下应该在应用程序的根文件夹中)一切正常 .
与我提及的内容相反,问题也可能是你有
#import
语句不应该存在 .Xcode确实推断出要与
#import
语句链接的框架 . 如果导入未链接的框架,然后你得到这个警告 .