Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ld: framework not found AFNetworking clang: error: linker command failed with exit code 1 (use -v to see invocation)

In my project I got cocoapod installed. Here is the structure of Podfile

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

platform :ios, '8.0'
use_frameworks!

workspace 'TempWorkspace'
inhibit_all_warnings!

target 'proj1' do

    pod 'ApplicationInsights', '1.0-beta.4'
    pod 'Google/Analytics'
    pod 'AFNetworking', '0.9.1'
    pod 'MBProgressHUD'
    pod 'Reachability'

end

target 'proj1Tests' do

end

target 'proj1UITests' do

end

In this, ApplicationInsights and GoogleAnalytics pod are not creating any issues. But if I add any pod except these 2 in this file, this is giving me following error

"ld: framework not found AFNetworking clang: error: linker command failed with exit code 1 (use -v to see invocation)"

Its not just about AFNetworking only if I write any other pod name also then also it is giving me same error with that pod name.

I tried looking for pod limitations but not it has not given me anything relevant.

If somebody has any idea please tell me.

Thanks in advance!!!


1 Answers

I hope it will help someone with a similar problem with Pods, this answer worked for me on XCode 8:

  1. Delete all your Podfiles from the pods folder (Pods folder should be empty)
  2. Delete the xcworkspace file
  3. run pod install
  4. Change Build Active Architectures Only to NO for your target and for all your pods (Click on Pods project and then on each single Pod)
  5. Add $(inherited) to the Framework Search Path setting of your target

I run into this problem because I was trying to install the latest Atlas pod which is implicitly installing the latest LayerKit pod and a reference to a framework was missing. For those with a similar problem remember to add use_frameworks! to your podfile.

like image 71
SwissMark Avatar answered Oct 27 '25 06:10

SwissMark