61

I'd like to ask and then answer this question.

I'd like to update the CocoaPods built into my app, so I ran pod install from the terminal.

That's when I got this error:

[!] The `APP_NAME [Debug]` target overrides the `FRAMEWORK_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.

How do you Use the $(inherited) flag?

Peter Brockmann
  • 3,594
  • 3
  • 28
  • 28

4 Answers4

125

Selected the Project, targets-> app, then Build Settings where I added the $(inherited) line, deleting whatever specific pod had been referenced there before:

enter image description here

starball
  • 20,030
  • 7
  • 43
  • 238
Peter Brockmann
  • 3,594
  • 3
  • 28
  • 28
  • 2
    Thx. I had to remove the pod that was specified and had to replace it with $(inherited) you mentioned. – palme Jan 21 '15 at 16:39
  • 2
    In my case, I need to add too $(PROJECT_DIR) – kakashy Feb 22 '16 at 16:58
  • This answer was the end of a long, long search. Thank you for posting answer and comments. – AndrewHenderson Mar 18 '17 at 03:59
  • Word of caution - I tried this solution, and though it did work for me, it created many other import issues that I had to resolve as well. It was not clear until I finished, whether or not I made things worse or better. Whoever reads this- stick with it and try to resolve the issues that this solution may make visible. – jungledev Jul 24 '17 at 18:35
  • Hello, I added this in and it resolved my issue with `framework not found Mapbox` but then followed with errors of `libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)` Please see https://stackoverflow.com/questions/47855382/mapbox-libcabi-dylib-terminating-with-uncaught-exception-of-type-nsexception – Michael Dec 17 '17 at 13:09
  • I am using Xcode 9.1 and nothing is mentioned under framework search paths. I simply added $(inherited) and build the project. And it worked !! Thanks @peter :) – Vijay Yadav Dec 18 '17 at 14:26
  • 1
    I want to point out that the "non-recursive" in the $(inherited) property is important. When set to "recursive" this TARGET OVERIDES error will not be solved. Tested on Xcode 10.3. – Ray Oei Aug 21 '19 at 14:11
  • I want to update the framework search path from terminal. Kindly help on that. Thanks in advanced!! – Deepak Saki Mar 15 '22 at 07:07
15

I was encountering this issue as well.

Aside from doing what Peter mentioned above, remember to double check if the correct Xcode project is selected in your podfile. This is because it is possible that you are changing the Build Settings of the incorrect Xcode project. It was a silly mistake, but it took quite some time before I realized it.

Normally, pod install works automatically if there is only one .xcodeproj file in the directory. However, if you are migrating your project to begin using cocoapods from the old way of manually adding frameworks/3rd party projects to your Xcode project, it is possible that you will have multiple .xcodeproj files in your folder. Doing the abovementioned fix didn't solve it for me, because I was editing the incorrect .xcodeproj file.

Go to your project directory, check the file named Podfile and make sure you specify the xcodeproj:

# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift

use_frameworks!
xcodeproj 'APP_NAME.xcodeproj'
target 'APP_NAME' do

# Your dependencies here
# pod 'NAME_OF_DEPENDENCY'
pod 'Google/CloudMessaging'
pod 'RxSwift',    '~> 2.0'
pod 'RxCocoa',    '~> 2.0'
pod 'RxBlocking', '~> 2.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'

After selecting the correct .xcodeproj on your Podfile, go to Xcode and do the following:

  1. From the Project Navigator on the left side, select your project.
  2. On the center screen, go to Build Settings
  3. Add a filter for 'Framework Search Paths'
  4. Enter $(inherited) as the value; it should auto-fill with data evaluating that expression

Below is an image of Xcode with Version 7.2 (7C68).

Xcode preview

shim
  • 9,289
  • 12
  • 69
  • 108
dsapalo
  • 1,819
  • 2
  • 19
  • 37
  • 1
    Just a note: CocoaPods 1.3.1 gives a deprecation warning: "`xcodeproj` was renamed to `project`. Please update your Podfile accordingly." – AmitaiB Sep 24 '17 at 18:08
0

I had a $(inherited) but recursive, just change it to non-recursive

project target -> build settings -> framework_search_path

enter image description here

yoc
  • 214
  • 2
  • 13
0

I had this same problem (error build: Framework not found Pods_xxx) when updating cordova-onesignal from v2 to 3.3.0 on an old Ionic 3 project.

This solved it for me:

In Xcode, navigate Project + Target + General + Scroll down to Frameworks, Libraries, and Embedded Content

In the list I simply deleted (minus sign at bottom of list) the related file Pods_xxx.framework (it was a little grayed out)

After rebuild everything worked (incl OneSignal)

If I do pod install it comes back and I have to do it all over again.

maxfloden
  • 178
  • 1
  • 10