Search code examples
iosframeworksx86-64digit

Undefined symbols for architecture x86_64 - ld: symbol(s) not found for architecture x86_64


I am not able to solve the below error. I have used cocoapods for external libs/frameworks.

Ld /Users/MyAppapp/Library/Developer/Xcode/DerivedData/MyApp-ceyvfirzookxqtdglefjjtyixokw/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp normal x86_64
    cd /Users/MyAppapp/Documents/MyApp-ios
    export IPHONEOS_DEPLOYMENT_TARGET=7.0
    export PATH="/Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode 2.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode\ 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -L/Users/MyAppapp/Library/Developer/Xcode/DerivedData/MyApp-ceyvfirzookxqtdglefjjtyixokw/Build/Products/Debug-iphonesimulator -L/Users/MyAppapp/Documents/MyApp-ios/Pods/Realm/core -F/Users/MyAppapp/Library/Developer/Xcode/DerivedData/MyApp-ceyvfirzookxqtdglefjjtyixokw/Build/Products/Debug-iphonesimulator -F/Users/MyAppapp/Documents/MyApp-ios/Pods/Crashlytics -F/Users/MyAppapp/Documents/MyApp-ios/Pods/Digits -F/Users/MyAppapp/Documents/MyApp-ios/Pods/Fabric -F/Users/MyAppapp/Documents/MyApp-ios/Pods/TwitterCore -F/Users/MyAppapp/Documents/MyApp-ios/Pods/TwitterKit -F/Users/MyAppapp/Documents/MyApp-ios -F/Users/MyAppapp/Documents/MyApp-ios/MyApp/Frameworks -F/Users/MyAppapp/Documents/MyApp-ios/MyApp/Frameworks/FacebookSDK -filelist /Users/MyAppapp/Library/Developer/Xcode/DerivedData/MyApp-ceyvfirzookxqtdglefjjtyixokw/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/MyApp.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=7.0 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -ObjC -lBolts -lDiskcached -lFBSDKCoreKit -lFBSDKLoginKit -lFBSDKShareKit -lImageLoader -lMBProgressHUD -lRealm -lc++ -lrealm-ios -lz -framework Accounts -framework AddressBook -framework CoreData -framework CoreGraphics -framework CoreText -framework Crashlytics -framework DigitsKit -framework Fabric -framework Foundation -framework QuartzCore -framework Security -framework Social -framework SystemConfiguration -framework TwitterCore -framework TwitterKit -framework UIKit -weak_framework Accounts -weak_framework AudioToolbox -weak_framework CoreGraphics -weak_framework CoreLocation -weak_framework Foundation -weak_framework QuartzCore -weak_framework Security -weak_framework Social -weak_framework UIKit -fobjc-arc -fobjc-link-runtime /Users/MyAppapp/Library/Developer/Xcode/DerivedData/MyApp-ceyvfirzookxqtdglefjjtyixokw/Build/Products/Debug-iphonesimulator/libMBProgressHUD.a -framework SystemConfiguration -framework QuartzCore -framework OpenGLES -lz -licucore -lc++ -framework ImageIO -framework GLKit -framework CoreText -framework CoreLocation -framework CoreData -framework AVFoundation -framework CoreGraphics -framework UIKit -framework Foundation -lPods -Xlinker -dependency_info -Xlinker /Users/MyAppapp/Library/Developer/Xcode/DerivedData/MyApp-ceyvfirzookxqtdglefjjtyixokw/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/MyApp_dependency_info.dat -o /Users/MyAppapp/Library/Developer/Xcode/DerivedData/MyApp-ceyvfirzookxqtdglefjjtyixokw/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp

ld: warning: directory not found for option '-F/Users/MyAppapp/Documents/MyApp-ios/MyApp/Frameworks'
ld: warning: directory not found for option '-F/Users/MyAppapp/Documents/MyApp-ios/MyApp/Frameworks/FacebookSDK'
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_TWTRAPIResponseValidator", referenced from:
      objc-class-ref in DigitsKit(DGTNetworkingHelper.o)
  "_OBJC_CLASS_$_TWTRGuestSessionRefreshStrategy", referenced from:
      objc-class-ref in DigitsKit(Digits.o)
  "_OBJC_CLASS_$_TWTRNetworkingPipeline", referenced from:
      objc-class-ref in DigitsKit(DGTNetworkingHelper.o)
  "_OBJC_CLASS_$_TWTRSessionStore", referenced from:
      objc-class-ref in DigitsKit(Digits.o)
  "_OBJC_CLASS_$_TWTRURLSessionDelegate", referenced from:
      objc-class-ref in DigitsKit(DGTNetworkingHelper.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Searched and tried many solution like - Linker error, verifying build setting OR framework missing from project directory, Changing valid architecture in build setting, cleaning up derived data but couldn't solve the issue.

In some post I saw missing #inclue or #import but in below errors I am not getting where. Any suggestion.


Solution

  • Finally Resolved.

    In my Podfile, the version number was not specified next to Digits framework. I modified that and kept the same number which TwitterCore had (i.e. 1.9.0) & saved it.

    Than, run pod install again. (This time it has fetched some missing data from digits framework)

    Hope it helps.