我正在尝试建立一个Xcode iOS项目,自从去年6月以来我就没有碰过这个项目。我知道有一些软件包的更新和一些Swift 4.2的更新,但是我得到了大量的错误。
首先,我遇到了一个库未加载的错误,类似于this,但对于RestKit。我将其添加到我的pod文件中,并将其包含到Link Binary with Libraries
中。然后,我收到了此错误消息。
Ld /Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/BuddyV2.app/BuddyV2 normal arm64 (in target: BuddyV2)
cd /Users/arkwl/Desktop/Workstation/OfficeBuddy/BuddyV2
export IPHONEOS_DEPLOYMENT_TARGET=11.3
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk -L/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/FirebaseAuth -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/FirebaseCore -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/FirebaseDatabase -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/FirebaseStorage -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/GTMSessionFetcher -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/GoogleUtilities -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/ISO8601DateFormatterValueTransformer -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/JSQMessagesViewController -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/JSQSystemSoundPlayer -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/RKValueTransformers -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/RestKit -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/SOCKit -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/SwiftInstagram -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/SwiftyJSON -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/TransitionKit -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/leveldb-library -F/Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/nanopb -F/Users/arkwl/Desktop/Workstation/OfficeBuddy/BuddyV2/Pods/FirebaseAnalytics/Frameworks -F/Users/arkwl/Desktop/Workstation/OfficeBuddy/BuddyV2/Pods/FirebaseInstanceID/Frameworks -F/Users/arkwl/Desktop/Workstation/OfficeBuddy/BuddyV2/Pods/GoogleAppMeasurement/Frameworks -F/Users/arkwl/Desktop/Workstation/OfficeBuddy/BuddyV2/Carthage/Build/iOS -filelist /Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Intermediates.noindex/BuddyV2.build/Debug-iphoneos/BuddyV2.build/Objects-normal/arm64/BuddyV2.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=11.3 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Intermediates.noindex/BuddyV2.build/Debug-iphoneos/BuddyV2.build/Objects-normal/arm64/BuddyV2_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode-marker -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Intermediates.noindex/BuddyV2.build/Debug-iphoneos/BuddyV2.build/Objects-normal/arm64/BuddyV2.swiftmodule -ObjC -lc++ -licucore -lsqlite3 -lz -framework CFNetwork -framework FIRAnalyticsConnector -framework FirebaseAnalytics -framework FirebaseAuth -framework FirebaseCore -framework FirebaseCoreDiagnostics -framework FirebaseDatabase -framework FirebaseInstanceID -framework FirebaseStorage -framework Foundation -framework GTMSessionFetcher -framework GoogleAppMeasurement -framework GoogleUtilities -framework ISO8601DateFormatterValueTransformer -framework JSQMessagesViewController -framework JSQSystemSoundPlayer -framework MobileCoreServices -framework RKValueTransformers -framework RestKit -framework SOCKit -framework Security -framework StoreKit -framework SwiftInstagram -framework SwiftyJSON -framework SystemConfiguration -framework TransitionKit -framework leveldb -framework nanopb -framework RestKit -framework LanguageTranslatorV2 -framework SpeechToTextV1 -framework TextToSpeechV1 -framework AssistantV1 -framework PersonalityInsightsV3 -framework Starscream -framework ConversationV1 -framework VisualRecognitionV3 -framework NaturalLanguageUnderstandingV1 -framework DiscoveryV1 -framework ToneAnalyzerV3 -framework NaturalLanguageClassifierV1 -framework Pods_BuddyV2 -Xlinker -dependency_info -Xlinker /Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Intermediates.noindex/BuddyV2.build/Debug-iphoneos/BuddyV2.build/Objects-normal/arm64/BuddyV2_dependency_info.dat -o /Users/arkwl/Library/Developer/Xcode/DerivedData/BuddyV2-gubyodomquayvxabpgpfpalrnftx/Build/Products/Debug-iphoneos/BuddyV2.app/BuddyV2
Undefined symbols for architecture arm64:
"type metadata for RestKit.JSON", referenced from:
type metadata accessor for Swift._HashableTypedNativeDictionaryStorage<Swift.String, RestKit.JSON> in SupportViewController.o
type metadata accessor for (Swift.String, RestKit.JSON) in SupportViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我试着查看SupportViewController.swift,看看是否有什么可能导致它,但没有发现任何东西。我也不知道如何使用-v来查看调用。什么可能导致这个问题?项目之前运行良好,我认为更新可能搞砸了一些事情。
下面是控制器的要点:https://gist.github.com/arkwl/8bcf492cef2e8408852d1be98172b7b7
我还尝试过将Linker Flags添加到pod项目中,如下所述:https://stackoverflow.com/a/26903572/4672331
是的,我试过重建。
1条答案
按热度按时间3phpmpom1#
嗯,这里有几种可能性,但最有可能的似乎是RestKit框架没有在您的代码之前构建。(正如注解中所建议的那样)在任何使用它的源代码中添加一个
import RestKit
语句。但是对我来说,这个错误意味着它找不到框架。我将回顾构建RestKit的日志部分,并确保这样做没有错误。一般来说,除非框架文档要求这样做,否则你不需要修改任何链接器标志,在框架搜索路径中没有正确的框架路径是这类问题的一个更常见的来源。
您还提到了之前加载框架映像时出现的问题。这通常是在应用启动期间实际尝试加载框架时出现的。最常见的原因是框架已被链接以进行编译,但未被复制到应用包中以进行部署。
因此,我建议查看RestKit框架是在哪里构建的,是如何构建的(Carthage或CocoaPods或其他东西),在框架搜索路径设置中指定的路径,然后是如何将框架添加到应用程序的。