5

Hi I'm having this issue:

ld: library not found for -lPods-Bolts

clang: error: linker command failed with exit code 1 (use -v to see invocation)

However, I downloaded the Bolt package from the Facebook Docs and put it into my supporting files. In addition, I'm using Cocoapods so I also downloaded Bolt using Cocoapods.

Ld /Users/mmk88/Library/Developer/Xcode/DerivedData/Jobazo-gejnfogovpyqypgovssmomabbuhl/Build/Products/Debug-iphoneos\ /Jobazo.app/Jobazo normal arm64
    cd /Users/mmk88/Desktop/Jobazo
    export IPHONEOS_DEPLOYMENT_TARGET=8.1
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk
-L/Users/mmk88/Library/Developer/Xcode/DerivedData/Jobazo-gejnfogovpyqypgovssmomabbuhl/Build/Products/Debug-iphoneos\
-F/Users/mmk88/Library/Developer/Xcode/DerivedData/Jobazo-gejnfogovpyqypgovssmomabbuhl/Build/Products/Debug-iphoneos\
-F/Users/mmk88/Desktop/Jobazo/Pods/Parse -F/Users/mmk88/Desktop/Jobazo/Pods/Parse-iOS -F/Users/mmk88/Desktop/Jobazo/Pods/ParseFacebookUtils -F/Users/mmk88/Documents/FacebookSDK -F/Users/mmk88/Desktop/Jobazo/Jobazo -filelist /Users/mmk88/Library/Developer/Xcode/DerivedData/Jobazo-gejnfogovpyqypgovssmomabbuhl/Build/Intermediates/Jobazo.build/Debug-iphoneos/Jobazo.build/Objects-normal/arm64/Jobazo.LinkFileList
-Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -ObjC -lPods-Bolts -lPods-Facebook-iOS-SDK -lPods-JSMessagesViewController -lPods-JSQSystemSoundPlayer -lPods-Parse -lPods-Parse-iOS -lPods-ParseFacebookUtils -lsqlite3 -lz -framework AudioToolbox -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework Foundation -framework MobileCoreServices -framework Parse -framework ParseFacebookUtils -framework QuartzCore -framework Security -framework StoreKit -framework SystemConfiguration -framework UIKit -weak_framework Accounts -weak_framework AdSupport
-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
-miphoneos-version-min=8.1 -lPods-JSQMessagesViewController -framework AudioToolbox -framework QuartzCore -framework Bolts -lPods-Bolts
-lPods-Facebook-iOS-SDK -lPods-JSMessagesViewController -lPods-JSQSystemSoundPlayer -lPods-Parse-iOS -lPods-Parse -lPods-ParseFacebookUtils -lPods -Xlinker -dependency_info -Xlinker /Users/mmk88/Library/Developer/Xcode/DerivedData/Jobazo-gejnfogovpyqypgovssmomabbuhl/Build/Intermediates/Jobazo.build/Debug-iphoneos/Jobazo.build/Objects-normal/arm64/Jobazo_dependency_info.dat -o /Users/mmk88/Library/Developer/Xcode/DerivedData/Jobazo-gejnfogovpyqypgovssmomabbuhl/Build/Products/Debug-iphoneos\ /Jobazo.app/Jobazo

Podfile:

source 'https://github.com/CocoaPods/Specs.git'  

platform :ios, '6.0' 

pod 'Parse-iOS' 

pod 'ParseFacebookUtils'  

pod 'JSMessagesViewController' 

pod 'Bolts'
Sven
  • 1,450
  • 3
  • 33
  • 58
mmk88
  • 91
  • 1
  • 6

3 Answers3

7

Typically this can happen sometimes when one of your pod dependencies is accidentally added to the Build Phases pane under "Link Binary With Libraries" of your Targets settings.

Removing the library ".a" file from the Build Phase should do the trick.

Daniel Galasko
  • 23,617
  • 8
  • 77
  • 97
  • Do you have any idea how this happens accidentally? Running into the same error with https://github.com/phonegap/phonegap-plugin-push which is using CocoaPods since the latest version. – Matthijs Bierman Nov 28 '16 at 13:15
  • Unfortunately I have no idea how it happens, I normally submit an issue to the pods team and take it from there @MatthijsBierman – Daniel Galasko Nov 28 '16 at 15:04
  • 1
    Thanks you so much. You've saved my night :) – Dimitri L. Dec 06 '16 at 18:47
  • There was a simple solution. Turns out that you needed to open the ```.xcworkspace``` file Cordova generated. It contains two projects. Before I could just open the ```.xcodeproj``` file, because there was only one project in the workspace. – Matthijs Bierman Dec 14 '16 at 10:04
  • running into this issue, its been 4 days trying to solve it no luck. Which exact ".a" file do you mean @DanielGalasko? – WhiteWabbit Jul 20 '22 at 04:44
  • Anything that has lPods in it @WhiteWabbit. Worth noting that this answer is very old now and pods are imported as frameworks now so its possible you have a different problem and should ask a question. – Daniel Galasko Jul 20 '22 at 13:28
0

My problem was that I changed the name of the project, so I reinstalled pods and in "Link Binary With Libraries" I had to delete "libPods-(old_pods_name).a" and also "Bolts.framework" and "Restkit.framework". Then reinstalled pods That worked for me!!!

Andrea.Ferrando
  • 987
  • 13
  • 23
0

I resolved this problem, by switching scheme to Pods-xxx, and build it first. Then, switch back to original project, and build it.

Let Pods-xxx build the necessary xxx.a first, resolve the dependency problem.

Switch scheme

On the toolbar, select

Product -> Scheme -> (Pods-xxx or original target)

AechoLiu
  • 17,522
  • 9
  • 100
  • 118