1

I am trying to build an Xcode iOS project I haven't touched since last June. I know there have been some updates with packages and something with Swift 4.2 but I got a multitude of errors.

Firstly I got a library not loaded error similar to this but for RestKit. I added it to my pods file and included it into Link Binary with Libraries. Then I got this error message.

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) 

I tried to look at SupportViewController.swift to see if there's anything that could be causing it but haven't found anything. Also I don't know how to use -v to see invocations. What could be causing this? The project was working fine before, I think the update might have messed up a few things.

Here's the gist for the controller: https://gist.github.com/arkwl/8bcf492cef2e8408852d1be98172b7b7

I have also tried adding the Linker Flags to the pods project, mentioned here: https://stackoverflow.com/a/26903572/4672331

Yes, I did try rebuilding.

user287474
  • 325
  • 1
  • 5
  • 19
  • Probably duplicate of https://stackoverflow.com/questions/50465639/rxtest-undefined-symbols-for-architecture-x86-64-and-arm64 – matt Sep 30 '18 at 18:01
  • @matt I added `import RestKit` as suggested in the link inside of the controller and it did not work. – user287474 Sep 30 '18 at 18:26

1 Answers1

1

Hmm. There's a few possibilities here but the most likely seems to be that the RestKit framework is not being built before your code. You should certainly have (as suggested in the comments) a import RestKit statement in any source code that uses it. But to me this error is saying it cannot find the framework. So I'd look back at the parts of the logs that built RestKit and make sure there are no errors doing that.

Generally speaking, unless a frameworks doco says to do so, you don't need to modify any linker flags. Not having the correct paths to the framework in the framework search paths is a more common source of this sort of issue.

Also you mention an earlier problem loading the framework image. This normally appears when actually trying to load the framework during your app's startup. The most common cause being that the framework has been linked in for compilation, but not copied into the application bundle for deployment.

So I'd suggest looking at where the RestKit framework is being built and how (Carthage or CocoaPods or something else), the paths specified in your framework search path settings and then how the framework is being added to the app.

drekka
  • 20,957
  • 14
  • 79
  • 135