3
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

4 Answers 4

13

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
3
  • This solution make some progress, Thanks. Commented May 3, 2021 at 2:01
  • Literally took hours of Googling to finally find this post. It worked perfectly! Thanks! Commented May 7, 2021 at 15:57
  • Still i couldn't find a solution for this. I flowed many answers. But still i stack with this issue. Des anyone has solution ? Commented Nov 22, 2022 at 16:22
2

I had the same issue you are describing. I tried most of the things you mention but none of them worked. In the past I have been 100% successful in running this on the simulator (whenever I was working on a non-UI thing) and needless to say also successful in running it on a real device. Something happened in the last 2 weeks where now neither the simulator nor the real-device can be used.

In the end I just decided to bite the bullet, start from scratch and clone the remote git repository from where the project resides. Note that before doing this I moved my non-working folder into a safe location (Desktop) and cloned the repository into the same location as the non-working used to be.

After that I ran pod install in the folder of the freshly-cloned project and ran it on a physical device. It worked on the first go. However I still cannot used the simulator. But I'm happy to have gained back the physical device at least.

UPDATE: SOLUTION FOUND!!

After about a day of researching and trying multiple things. I found a solution here: https://github.com/CocoaPods/CocoaPods/issues/10059#issuecomment-693346078

Short summary a new entry is added; it is located in Build Settings->User-Defined->VALID-ARCHS. I deleted this, and now I can run both on simulator and on-device.

1
  • Your last-minute update/edit got my project back up and running. Not sure how you found that, but so glad you did! THANKS!
    – Mike Fahy
    Commented Nov 11, 2020 at 21:44
1

Please try delete the Derived Data and pod install again /Library/Developer/Xcode/DerivedData

pod install 
2
  • doesnt work. this issue started after upgrading to xcode 12 Commented Oct 18, 2020 at 19:59
  • 1
    Worth to note, it runs on real physical device. but not simulator Commented Oct 18, 2020 at 21:34
1

Go to Build Settings Add new key under User-Defined section

VALID_ARCHS : armv7 armv7s arm64 arm64e x86_64

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.