Search code examples
iosswiftxcodecocoapodspreview

ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator'


I have problem running Xcode previews in my project. Once I try to start it I get the following error no matter the view I'm trying to preview. Running the app on physical device or simulator works just fine.

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

----------------------------------------

LinkDylibError: Failed to build CustomTextField.swift

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

ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator'
Undefined symbols for architecture arm64:
  "___llvm_profile_runtime", referenced from:
      ___llvm_profile_runtime_user in FBLPromises(PromisesObjC-dummy.o)
      ___llvm_profile_runtime_user in FBLPromises(FBLPromise.o)
      ___llvm_profile_runtime_user in FBLPromises(FBLPromise+All.o)
      ___llvm_profile_runtime_user in FBLPromises(FBLPromise+Always.o)
      ___llvm_profile_runtime_user in FBLPromises(FBLPromise+Any.o)
      ___llvm_profile_runtime_user in FBLPromises(FBLPromise+Async.o)
      ___llvm_profile_runtime_user in FBLPromises(FBLPromise+Catch.o)
      ...
     (maybe you meant: ___llvm_profile_runtime_user)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have already tried reintegrating pods and removing Framework Search Paths as -F option suggested it in above error. This brought no success.


Solution

  • I had a similar issue and solved it by adding -fprofile-instr-generate to Build Settings > Linking > Other Linker Flags