Xcode链接器错误:找不到文件

时间:2016-11-17 05:51:35

标签: ios swift xcode cocoapods linker-errors

我目前正在我的Xcode项目中使用cocoapods为我的应用创建一个google登录按钮,再次完成教程后,仍然会出现构建错误。以下是在构建时显示的错误消息。非常感谢解决此问题的任何帮助。

短错误消息(在控制台错误消息的末尾)

ld: file not found: /Users/tarunaarora/Desktop/GunnOracleApplication/Pods/GoogleUtilities/Libraries/libGTM_NSData+zlib_external.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)

完整错误消息(短错误消息上方的错误消息):

Ld /Users/tarunaarora/Library/Developer/Xcode/DerivedData/GunnOracleApplication-epkumjpjfmvimzansuewkghneyzh/Build/Products/Debug-iphonesimulator/GunnOracleApplication.app/GunnOracleApplication normal x86_64
        cd /Users/tarunaarora/Desktop/GunnOracleApplication
        export IPHONEOS_DEPLOYMENT_TARGET=10.2
        export PATH="/Users/tarunaarora/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Users/tarunaarora/Downloads/Xcode-beta.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
        /Users/tarunaarora/Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Users/tarunaarora/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -L/Users/tarunaarora/Library/Developer/Xcode/DerivedData/GunnOracleApplication-epkumjpjfmvimzansuewkghneyzh/Build/Products/Debug-iphonesimulator -L/Users/tarunaarora/Desktop/GunnOracleApplication/Pods/Firebase -F/Users/tarunaarora/Library/Developer/Xcode/DerivedData/GunnOracleApplication-epkumjpjfmvimzansuewkghneyzh/Build/Products/Debug-iphonesimulator -F/Users/tarunaarora/Library/Developer/Xcode/DerivedData/GunnOracleApplication-epkumjpjfmvimzansuewkghneyzh/Build/Products/Debug-iphonesimulator/GTMOAuth2 -F/Users/tarunaarora/Library/Developer/Xcode/DerivedData/GunnOracleApplication-epkumjpjfmvimzansuewkghneyzh/Build/Products/Debug-iphonesimulator/GTMSessionFetcher -F/Users/tarunaarora/Library/Developer/Xcode/DerivedData/GunnOracleApplication-epkumjpjfmvimzansuewkghneyzh/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac -F/Users/tarunaarora/Desktop/GunnOracleApplication/Pods/FirebaseAnalytics/Frameworks/frameworks -F/Users/tarunaarora/Desktop/GunnOracleApplication/Pods/FirebaseCore/Frameworks/frameworks -F/Users/tarunaarora/Desktop/GunnOracleApplication/Pods/FirebaseInstanceID/Frameworks/frameworks -F/Users/tarunaarora/Desktop/GunnOracleApplication/Pods/Google/Frameworks -F/Users/tarunaarora/Desktop/GunnOracleApplication/Pods/GoogleAppUtilities/Frameworks/frameworks -F/Users/tarunaarora/Desktop/GunnOracleApplication/Pods/GoogleInterchangeUtilities/Frameworks/frameworks -F/Users/tarunaarora/Desktop/GunnOracleApplication/Pods/GoogleSignIn/Frameworks -F/Users/tarunaarora/Desktop/GunnOracleApplication/Pods/GoogleSymbolUtilities/Frameworks/frameworks -filelist /Users/tarunaarora/Library/Developer/Xcode/DerivedData/GunnOracleApplication-epkumjpjfmvimzansuewkghneyzh/Build/Intermediates/GunnOracleApplication.build/Debug-iphonesimulator/GunnOracleApplication.build/Objects-normal/x86_64/GunnOracleApplication.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=10.2 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/tarunaarora/Library/Developer/Xcode/DerivedData/GunnOracleApplication-epkumjpjfmvimzansuewkghneyzh/Build/Intermediates/GunnOracleApplication.build/Debug-iphonesimulator/GunnOracleApplication.build/Objects-normal/x86_64/GunnOracleApplication_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L/Users/tarunaarora/Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/tarunaarora/Library/Developer/Xcode/DerivedData/GunnOracleApplication-epkumjpjfmvimzansuewkghneyzh/Build/Intermediates/GunnOracleApplication.build/Debug-iphonesimulator/GunnOracleApplication.build/Objects-normal/x86_64/GunnOracleApplication.swiftmodule -ObjC -lc++ -lsqlite3 -lstdc++ -lz -framework AddressBook -framework AssetsLibrary -framework CoreFoundation -framework CoreLocation -framework CoreMotion -framework CoreText -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseInstanceID -framework GGLCore -framework GGLSignIn -framework GTMOAuth2 -framework GTMSessionFetcher -framework GoogleAppUtilities -framework GoogleInterchangeUtilities -framework GoogleSignIn -framework GoogleSymbolUtilities -framework GoogleToolboxForMac -framework MessageUI -framework SafariServices -framework Security -framework StoreKit -framework SystemConfiguration -lGGLCore -lGGLSignIn -lGIPNSURL+FIFE_external -lGSDK_Overload_external -lGTMOAuth2_external_external -lGTMOAuth2_internal_external -lGTMSessionFetcher_core_external -lGTMSessionFetcher_full_external -lGTMStackTrace_external -lGTM_AddressBook_external -lGTM_DebugUtils_external -lGTM_GTMURLBuilder_external -lGTM_KVO_external -lGTM_NSData+zlib_external -lGTM_NSDictionary+URLArguments_external -lGTM_NSScannerJSON_external -lGTM_NSStringHTML_external -lGTM_NSStringXML_external -lGTM_Regex_external -lGTM_RoundedRectPath_external -lGTM_StringEncoding_external -lGTM_SystemVersion_external -lGTM_UIFont+LineHeight_external -lGTM_core_external -lGTM_iPhone_external -lOpenInChrome_external -lProtocolBuffers_external -lSignIn_external -lc++ -lsqlite3 -lstdc++ -lz -framework AddressBook -framework AssetsLibrary -framework CoreFoundation -framework CoreGraphics -framework CoreLocation -framework CoreMotion -framework CoreText -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseInstanceID -framework GoogleToolboxForMac -framework MessageUI -framework SafariServices -framework Security -framework StoreKit -framework SystemConfiguration -force_load /Users/tarunaarora/Desktop/GunnOracleApplication/Pods/GoogleUtilities/Libraries/libGTM_NSData+zlib_external.a -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/tarunaarora/Library/Developer/Xcode/DerivedData/GunnOracleApplication-epkumjpjfmvimzansuewkghneyzh/Build/Intermediates/GunnOracleApplication.build/Debug-iphonesimulator/GunnOracleApplication.build/GunnOracleApplication.app.xcent -framework Pods_GunnOracleApplication -Xlinker -dependency_info -Xlinker /Users/tarunaarora/Library/Developer/Xcode/DerivedData/GunnOracleApplication-epkumjpjfmvimzansuewkghneyzh/Build/Intermediates/GunnOracleApplication.build/Debug-iphonesimulator/GunnOracleApplication.build/Objects-normal/x86_64/GunnOracleApplication_dependency_info.dat -o /Users/tarunaarora/Library/Developer/Xcode/DerivedData/GunnOracleApplication-epkumjpjfmvimzansuewkghneyzh/Build/Products/Debug-iphonesimulator/GunnOracleApplication.app/GunnOracleApplication

这就是我的Xcode Project Podfile文档和Pod显示的内容:

Podfile and Pods image

我目前也在使用Xcode 8.2 beta

编辑:

最后,我已经解决了我为解决问题所采取的措施,因为大多数其他问题都没有奏效。请随意查看解决方案。

4 个答案:

答案 0 :(得分:2)

  1. 在你的podfile中,注意`到'之间的区别。 enter image description here

  2. 更正后,您可以:

    一个。清洁项目(产品 - >清洁)

    湾关闭XCode

    ℃。运行pod install

    d。打开yourProjectName.xcworkspace

答案 1 :(得分:0)

您应该更改scheme。删除旧的Product并添加新的!{/ p>

您可以转到Scheme>自动创建目标方案。 Manage Schemes> "Autocreate Schemes Now"并按import re import os files = [os.path.abspath(f) for f in os.listdir('c:\\data') if re.search(r'[A-Z]+.*\.csv$', f)]

参考:this so post

答案 2 :(得分:0)

打开构建设置 转到框架搜索路径

enter image description here这继承了&项目目录将导致从Pod中自动检测,并且不会给您带来更多问题。尝试这样做会自动检测到pod。可能这可以帮助

答案 3 :(得分:0)

在阅读了上述解决方案之后,他们都没有为我工作,所以我开始尝试自己,看看是否有任何其他解决方案来解决这个问题。

以下是导致我解决此问题的步骤:

  1. 重新创建项目。 (我复制了我需要的文件,遗漏了我不需要的文件,所以我只复制了Main.storyboard和Assets文件)

  2. 正确安装Pod。 (我查看了我再次使用的教程,并确保我安装了他正在安装的相同的pod。项目构建没有任何错误。)

  3. 编写ViewController.swift和Appdelegate文件。 (我再次观看了教程,并仔细重新编写了他在教程中编写的代码)

  4. 构建项目并理解错误。 (我使用正确的方案设置构建了项目,然后我经历了控制台中显示的任何错误,并对其进行了更正。)我遇到的所有错误都在教程中提供了解决方案。

  5. 现在项目已成功创建,没有任何错误!