Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Library not found for -lAFNetworking Xcode issues

ld: warning: directory not found for option '-L/Users/kh/Library/Developer/Xcode/DerivedData/om-euxqzibzllbcmndwqrgthdeotiro/Build/Products/Debug-iphonesimulator/AFNetworking'
ld: warning: directory not found for option '-L/Users/kh/Library/Developer/Xcode/DerivedData/om-euxqzibzllbcmndwqrgthdeotiro/Build/Products/Debug-iphonesimulator/JSONModel'
ld: warning: directory not found for option '-L/Users/kh/Library/Developer/Xcode/DerivedData/om-euxqzibzllbcmndwqrgthdeotiro/Build/Products/Debug-iphonesimulator/ReactiveCocoa'
ld: warning: directory not found for option '-L/Users/kh/Library/Developer/Xcode/DerivedData/om-euxqzibzllbcmndwqrgthdeotiro/Build/Products/Debug-iphonesimulator/Realm'
ld: warning: directory not found for option '-L/Users/kh/Library/Developer/Xcode/DerivedData/dom-euxqzibzllbcmndwqrgthdeotiro/Build/Products/Debug-iphonesimulator/SAMKeychain'
ld: warning: directory not found for option '-L/Users/kh/Library/Developer/Xcode/DerivedData/om-euxqzibzllbcmndwqrgthdeotiro/Build/Products/Debug-iphonesimulator/Sentry'
ld: library not found for -lAFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Some Solutions I tried , and all of below didn't work which was previously suggested on similar stackoverflow questions

  • Opening xcworkspace, yes I am opening that.Not the project
  • Restart xcode
  • Clean & Build multiple times.
  • Deleted pods folder, and installed pods again.
  • pod update multiple times
  • set Build Active architecture Only to Yes
  • Selected my Target, went to "Build Phases" in "Link Binary With Libraries" removed ".a" file of that library. Clean and Build.
  • Target -> Build Settings ->Other Linker Flags = $(inherited)
  • Target -> Build Settings ->Library Search Path = $(inherited)

Note that libPods-om.a is giving me red whenever i add in target ( choose frameworks and libraries to add)

Worth to note, it runs onreal physical device. but not simulator

like image 599
user3278732 Avatar asked Jan 26 '26 22:01

user3278732


1 Answers

I had same issue on Xcode 12.4, only on simulators (on device works well). Solved by adding arm64 for key Any iOS Simulator SDK on Build Settings < Excluded Archicetures. Add on

  1. Project settings, and
  2. Pods settings

enter image description here

Or, you can try another solution (also worked for me):

  1. adding arm64 for key Any iOS Simulator SDK on Project settings
  2. add config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" on Pod file
like image 114
pajtimid Avatar answered Jan 28 '26 15:01

pajtimid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!