‘ld: warning: directory not found for option’

Xcode

Xcode Problem Overview


When I'm building my Xcode 4 apps I'm getting this warning:

ld: warning: directory not found for option '-L/Users/frenck/Downloads/apz/../../../Downloads/Google Analytics SDK/Library'
ld: warning: directory not found for option '-L/Users/frenck/Downloads/apz/../Google Analytics SDK/Library'

But I do not have Google Analytics in my app, I deleted all of it how can I remove the error? And archiving an app gives me the error:

clang: error: no such file or directory: 'armv6'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

I've tried so many things but I'm still getting this error when I'm trying to make an .IPA file

Xcode Solutions


Solution 1 - Xcode

You need to do this:

  1. Click on your project (targets)
  2. Click on Build Settings
  • if your error includes the -L flag, then delete the values in Library Search Paths
  • if your error includes the -F flag, then delete the values in Framework Search Paths

And regarding the second error, sorry i can't help you out with that one. Hope someone else can help you out.

Solution 2 - Xcode

There are two errors that people seem to be confusing.

If it is a "directory not found for option '-L/..." error, that means it's a Library Error, and you should try to:

  • Click on your project (targets)
  • Click on Build Settings
  • Under Library Search Paths, delete the paths

If it is a "directory not found for option '-F/...", that means it's a Framework Error, and you should try to:

  • Click on your project (targets)
  • Click on Build Settings
  • Under Framework Search Paths, delete the paths

This might happen when you move the referenced file around.

Solution 3 - Xcode

My problem was that I opened the original .xcodeproj instead of the .xcworkspace that was generated by CocoaPods.

Solution 4 - Xcode

I had to remove the references at:

  • Target
  • Build Settings
  • Framework Search Paths

enter image description here

Then the build was broken (expected). So I removed the Framework (FB SDK), re-added it and voila. No more errors or warnings. :)

Solution 5 - Xcode

I use cocoa pods so for me, I quit Xcode and ran

pod install

again and reopened the project. This fixed everything!

Solution 6 - Xcode

For me the problem was a missing escape "" character.

My search paths were broken up on several lines in the Library Search Paths. Conveniently, they were breaking at spaces in my path. Adding the escape "" fixed it for me.

$(PROJECT_DIR)/My\ Project\ Name/My\ Directory

Solution 7 - Xcode

I found the reference which I had to remove at:

  • Target
  • Build Settings
  • Header Search Paths

Solution 8 - Xcode

In my case the problem was Framework Search paths that had incomplete, dead, old links or multiple frameworks of same type. Remove them and your project will compile without any problem.

be sure to do Build -> clean

enter image description here

Solution 9 - Xcode

I ran into the same problem (the first one) after an Xcode crash and none of the solutions proposed worked. To suppress the warning I have done:

• manage schemes...

• deleted the current scheme

• Autocrate Schemes Now

Solution 10 - Xcode

This is what worked for me:

  1. Click on Project
  2. Click on Build Settings
  3. Search for "Framework Search Paths"
  4. Clear the path and type "$(inherited)"

Solution 11 - Xcode

I got bit by what appears to be the same issue too (this time in XCode 5.0.2). In my case, what happened was XCode decided to escape the quotes already in the "Build Settings". So for example:

"$(SRCROOT)/../GoogleAdMobAdsSdkiOS-6.4.1"

became

\"$(SRCROOT)/../GoogleAdMobAdsSdkiOS-6.4.1\"

which caused the build to fail...

Once I removed the escapes on the quotes everything worked fine again. In addition, it would probably be best to remove the quotes altogether unless you need them.

Solution 12 - Xcode

If this happens after you've added a Podfile to your project and run pod install, go to your project folder, you'll see a new file that has been created "{ProjectName}.xcworkspace" -- open that file in xcode

The pods that have been installed will be properly linked to your project in this file

Solution 13 - Xcode

there might be a mismatch in deployment targets. pods are installed for 11.0 and the Xcode is searching in 10.0 folders

Solution 14 - Xcode

Follow this step-by-step solution:

  1. Click on your project (targets);
  2. Click on Build Settings;
  3. Under Library Search Paths, delete the paths;
  4. Add ./** on Library Search Paths.

Solution 15 - Xcode

Supplemental answer

All the answers said to either delete the Framework or Library search paths from the target. I had two problems:

  • First, I was looking at my main project target rather than the Unit Test target.
  • Second, I couldn't figure out how to delete the framework search path. It turned out that it was just clicking it to get in edit mode and then just deleting the string.

Solution 16 - Xcode

For me the problem seemed to be that I hadn't included the appropriate frameworks (when copying addons from another project I didn't copy the frameworks files as well)

Solution 17 - Xcode

The key for this type of error is to go into build settings and look at each of the search paths sections such as Library Search Paths, Framework Search Paths and possibly even Header Search Paths and clear out any of the paths that no longer apply that your app is having a hard time trying to find. Remove them and carry on good sir

Solution 18 - Xcode

go check out which framework is missing , then go to

=> Build Phases => Link Binary With Libraries

remove the library and then add back

Solution 19 - Xcode

I had a similar problem that went away when I created a new scheme and used it to rebuild???

Solution 20 - Xcode

For me I have also Tests enabled. The search path for tests was also filled incorrect.

Clear the Framework Search Path for both the regular code and the test code!

Solution 21 - Xcode

Because of the custom directories that have entered to the search paths ( frameworks and library ), the project overrides pod's directories. so it can't find it.

To solve this problem, delete all custom directories from

Search Paths -> Library Paths and Framework Paths,

only see ${inherited}.

I hope this helps. It worked for me.

Solution 22 - Xcode

If you installed any new pod and then got this error, just quit the xcode > open again > build the project

Solution 23 - Xcode

enter image description here

Add $(inherited) -Objc -lcrypto - lssl in Project -> Build Setting -> Search path -> Library Search Path

Solution 24 - Xcode

If this happens after a pod install with some dependencies, the problem might be you are using the old version of the app(.xcworkspace) on Xcode.

After a pod install, this is the output you may see.

The output of a pod install.

Output of a pod install

Do exactly that, close your current Xcode window and open the new .xcworkspace.

Opening the new xcworkspace]

Opening the new xcworkspace

Solution 25 - Xcode

you should check option for this:

Build Settings-> Framework Search Paths-> {input Your Project Path}

Solution 26 - Xcode

I've looked into all [Library Search Paths - Framework Search Paths - Header Search Paths]. but there are no paths to remove, so I was able to make this alert go away by going into the Xcode bundle and creating an empty directory at the path location that the alert was complaining about.

Solution 27 - Xcode

Make sure only 1 "libFlurry.a" selected in target

worked for me.

enter image description here

Solution 28 - Xcode

>>>Do not forget to create the same configuration for Pod project in your workspace, If you change into MainApps new configuration.

For example,

In my case, to resolve this issue I had to create ReleaseOfficial configuration as well for Pod projects when I created ReleaseOfficial configuration for my MainApp.

Solution 29 - Xcode

If the typical solution doesn't resolve the issue, what fixed it for me was ensuring that all iOS versions in the xcode project (e.g. IPHONEOS_DEPLOYMENT_TARGET) / deployment targets, podfiles (if applicable), etc. are set to the same version number.

Solution 30 - Xcode

1- select your target

2- open build settings

3- search for "framework search paths"

4- delete all "framework search paths"

5- then install the pods again

6- add in the "framework search paths" $(inherited)

7- clear cmd + k

8- build cmd + b

Solution 31 - Xcode

I had same problem, it was due to a line I added in my pods. I used next line in post install for some errors. Just remove if you have used the same:

#config.build_settings['CONFIGURATION_BUILD_DIR'] = '$PODS_CONFIGURATION_BUILD_DIR'

Solution 32 - Xcode

For me the issue was having a space in the Configuration name like "Development Debug". Once I removed the space and made it "DevelopmentDebug", the error message went away.

Solution 33 - Xcode

Solution for those who have the problem with pods. It is also helpful to run a 'pods deinstall', clean and close the project. Reinstall the Pods with 'pods install' and open the project again. Worked for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFrenckView Question on Stackoverflow
Solution 1 - XcodeBlazerView Answer on Stackoverflow
Solution 2 - XcodeMarcView Answer on Stackoverflow
Solution 3 - XcodelujopView Answer on Stackoverflow
Solution 4 - Xcodebackslash-fView Answer on Stackoverflow
Solution 5 - XcodeLazar KukoljView Answer on Stackoverflow
Solution 6 - XcodeIron MikeView Answer on Stackoverflow
Solution 7 - XcodeJasperView Answer on Stackoverflow
Solution 8 - XcodeSam BView Answer on Stackoverflow
Solution 9 - XcodeFrancescoView Answer on Stackoverflow
Solution 10 - XcodeMajor MacGregorView Answer on Stackoverflow
Solution 11 - XcodeBrad FolkensView Answer on Stackoverflow
Solution 12 - XcodeGaurav ChaturvediView Answer on Stackoverflow
Solution 13 - XcodeMadhu KumarView Answer on Stackoverflow
Solution 14 - XcodekrishnaView Answer on Stackoverflow
Solution 15 - XcodeSuragchView Answer on Stackoverflow
Solution 16 - XcodestudiouView Answer on Stackoverflow
Solution 17 - XcodeChris KlinglerView Answer on Stackoverflow
Solution 18 - Xcodechings228View Answer on Stackoverflow
Solution 19 - XcodeprankinView Answer on Stackoverflow
Solution 20 - XcodeVincentView Answer on Stackoverflow
Solution 21 - XcodeAlperen AdatepeView Answer on Stackoverflow
Solution 22 - XcodeViral SavaliyaView Answer on Stackoverflow
Solution 23 - XcodeBandish KumarView Answer on Stackoverflow
Solution 24 - XcodeEliah MbwiloView Answer on Stackoverflow
Solution 25 - Xcodekingboylee0595View Answer on Stackoverflow
Solution 26 - XcodeMohammed FathyView Answer on Stackoverflow
Solution 27 - XcodeOfir MalachiView Answer on Stackoverflow
Solution 28 - XcodeSazzad Hissain KhanView Answer on Stackoverflow
Solution 29 - XcodeEmpireJonesView Answer on Stackoverflow
Solution 30 - XcodeAhmed SamirView Answer on Stackoverflow
Solution 31 - Xcodebilal khanView Answer on Stackoverflow
Solution 32 - XcodezeusstlView Answer on Stackoverflow
Solution 33 - Xcodeuser15578084View Answer on Stackoverflow