101

I know this has been asked a couple of times. I followed instructions from these ones:

Adding frameworks to project in Xcode 5 and having *relative* paths added

xcode4: Linker error: Directory not found for option

Still Xcode is giving this error:

enter image description here

Here's my current configuration:

enter image description here

enter image description here

The bolts framework is so I can use the Parse SDK. I downloaded the blank project from here: https://parse.com/apps/quickstart#parse_data/mobile/ios/native/new

It's working. I tried to copy every config option, but it still doesn't work.

Alexander Abakumov
  • 13,617
  • 16
  • 88
  • 129
Kim Montano
  • 2,185
  • 4
  • 26
  • 39

27 Answers27

84

Try deleting Bolts.framework from linked framework and re-add it. Also, in your Framework Search Path keep path until Bolts.framework like $(PROJECT_DIR)/Bolts if it is inside Bolts folder at your project directory path.

Abhinav
  • 37,684
  • 43
  • 191
  • 309
  • 3
    For the framework search path, go to your project, select your target, and then go to build settings. Search `framework` until you see in bold the framework search path. – George May 18 '19 at 21:06
41

I'm pretty new to iOS development. Apparently this problem for me was a result of opening the .xcodeproj Xcode project instead of the .xcworkspace Xcode workspace. I opened the workspace instead and the error has gone away.

Lou Morda
  • 5,078
  • 2
  • 44
  • 49
  • This solves it for me to, but when I open the workspace, all I can see is the ViewController.class file. When I try to open the other files, they open in a side view, which can't really read xib files right. Do you know a work around for this? – Sam Mar 23 '19 at 06:21
18

Xcode error: Framework not found

If you use CocoaPods try to run:

pod deintegrate
pod update

Also use .xcworkspace instead of .xcodeproj

yoAlex5
  • 29,217
  • 8
  • 193
  • 205
12
  1. Delete the framework link from the Xcode project setting.
  2. Move the framework to the Project Folder.
  3. Re-add the framework in the Xcode project setting.
  4. clean the project and re-compile it.
August Lin
  • 1,249
  • 12
  • 11
  • 5
    The important part of these instructions for me was that when I moved my framework into my project folder rather than having it live elsewhere in my file system, Xcode automatically added the framework's parent folder to my target's `Framework Search Paths` Build Setting when I re-added the framework to the target in Xcode. I decided to add a `Frameworks` folder in my project such that my target had a `Framework Search Paths` entry as follows: `"$(PROJECT_DIR)/Frameworks"`. – Adil Hussain Oct 30 '20 at 09:55
  • How do you delete a framework link from an xcode project setting? The XCode UI keeps changing – Warren P May 07 '22 at 19:00
8

delete all frameworks from Embedded Binaries and re-add it

frank
  • 101
  • 1
  • 4
8

me too was getting this error , I moved the framework file to the root project folder and added to framework again and problem is solved.

ali ozkara
  • 5,425
  • 2
  • 27
  • 24
7

1:- Delete the framework from the Xcode project. Quit the Xcode.

2:- Open your project in XCode and go to file under Menu and select Add files to "YourProjectName".

enter image description here

3:- Select "YourFramwork.framework" in the directory where you keep it.

4:- Click on the Copy items if needed checkbox.

5:- Click Add.

enter image description here

Make sure that you have the framework added in both Embedded Binaries and Linked Frameworks and Libraries under Target settings - General. As shown in the following images:-

enter image description here

enter image description here

Ashutosh Mishra
  • 1,679
  • 1
  • 13
  • 16
  • 1
    The important part of these instructions for me was that when I copied the framework into my project before adding it to my target, Xcode automatically added an entry for it in my target's `Framework Search Paths` Build Setting. I decided to copy the framework into a `Frameworks` folder in my project such that my target had a `Framework Search Paths` entry as follows: `"$(PROJECT_DIR)/Frameworks"`. – Adil Hussain Oct 30 '20 at 10:00
5

Here is the solution :

Turn the "$(PROJECT_DIR)" attribute(might be non-recursive by default) into recursive option in Select Project Click on Targets Click - Build Settings Search for 'Framework Search Path' - Double click the input.

Scratched from https://stackoverflow.com/a/31298214/4493512

Community
  • 1
  • 1
5

Delete the framework that is causing the issue (by removing the reference).

Then add it again, following these steps for adding FBSDK frameworks and libraries:

  1. click project
  2. general settings
  3. linked framework and libraries
  4. click the plus button and add all that you want
shim
  • 9,289
  • 12
  • 69
  • 108
AyAz
  • 2,027
  • 2
  • 21
  • 28
  • I would have thought this would work by itself, but even after doing this, I still had to clear the "Target Membership" checkbox, run Product > Clean, then set the Target Membership checkbox again. – Michael Jul 25 '19 at 11:49
5

Besides from removing the framework from the Podfile and Linked Frameworks and Libraries, I also had to remove the reference to the framework in Other Linker Flags.

Andre Simon
  • 665
  • 10
  • 16
  • This is GOLD! Tysm – Matea Jun 03 '21 at 13:39
  • After I removed a package reference from my `pubspec.yaml`, and did `flutter clean && rm ios/Podfile.lock pubspec.lock && rm -rf ios/Pods ios/Runner.xcworkspace` followed by an attempted `flutter build ipa` (which re-adds the things that were removed), I had to also remove the reference to the framework in `Other Linker Flags` in both the Project `Runner` and the Target `Runner` Build Settings. After that, `flutter build ipa` worked for me. – Tommy Elliott Oct 11 '21 at 21:10
5

I just had the same situation (was having a hard time to address the OP's build error after adding a 3rd party framework) and it seems like a bug in Xcode (mine is 8.3.2 (8E2002)).

The problem was that a folder name in path to the framework contained spaces. In this case, Xcode incorrectly escaped them with backslashes like this in Build Settings -> Framework Search Paths:

$(PROJECT_DIR)/Folder\ with\ spaces/Lib

To fix this, just manually edit the entry to remove those backslashes and enclose the whole string in quotes like this:

"$(PROJECT_DIR)/Folder with spaces/Lib"
Alexander Abakumov
  • 13,617
  • 16
  • 88
  • 129
4

Error: Framework not found

If you use CocoaPods try to run these commands from terminal:

Intel chip:

pod deintegrate
pod update

Apple Silicon M1 chip:

pod deintegrate
arch -x86_64 pod update

Also use .xcworkspace instead of .xcodeproj

Rabel Ahmed
  • 1,131
  • 13
  • 12
  • I'm having Silicion M1 chip and 'pod update' command worked for me. So, first solution works for both Intel/Apple Silicon M1 chip.. – Jayprakash Dubey Jul 24 '23 at 07:10
3

None of the above worked for me until I found that I had a blank "Any Architecture | Any SDK" line underneath Framework Search Paths / Debug under Build Settings.

Deleted the line and it works!

Dave
  • 71
  • 5
1

When this error occurred to me was because Pods folder was in iCloud and had no local copy on my computer. Go to your project's folder in Finder and check if there is iCloud's symbol in any of the folders inside it!

Laura Corssac
  • 1,217
  • 1
  • 13
  • 23
1

I realised that I hadn't run/built my framework with the Generic Device, which strangely lead to these issues. I just put the framework back in and it worked.

George
  • 25,988
  • 10
  • 79
  • 133
1

If you are using CocoaPods. Similar thing has happened to me. Although this question is old someone like me might still be struggling. So for to help: after pod install it warns you about project files. I didn't notice till now. it says:

[!] Please close any current Xcode sessions and use ProjectFile.xcworkspace for this project from now on.

So basically, do not continue working on .xcodeproj after installing Pods. If you do linker won't find files.

Dharman
  • 30,962
  • 25
  • 85
  • 135
GO.exe
  • 646
  • 7
  • 13
0

My framework has long name like FrameworkSDK_Light-1.0.6.framework so I renamed it to FrameworkSDK_Light.framework and it solved my problem.

0

I got the error 'AdBrixRM framework not found'. I checked the AdBrixRM.framework. I noticed that 'AdBrixRM' excution file is missed. I copied this file into the framework folder and the issue was gone.

YingTai.Z
  • 21
  • 3
0

I used to encounter this same exact issue in the past with Google Admob SDK. Most recently, this happened when trying to add Validic libraries. I tried the same old good trick this time around as well and it worked in a jiffy.

1) Remove the frameworks, if already added.

2) Locate the framework in Finder and Drag & Drop them directly into the Project Navigator pane under your project tree.

3) Build the project and Whooo!

Not sure what makes the difference, but adding the frameworks by the official way of going to the section "Linked Framework & Libraries" under project settings page (TARGET) and linking from there does not work for me. Hope this helps.

programmer
  • 507
  • 5
  • 16
0

I found that the file.framework was referencing a file outside my project. So I dragged the file into my frameworks folder under my project and then got rid of the earlier file.framework file and it worked.

Ahmad Labeeb
  • 1,056
  • 11
  • 21
0

add github "BoltsFramework/Bolts-iOS" on your cartfile. then carthage update. after copy Bolts.framework from ../carthage/Build/iOS

M Mahmud Hasan
  • 1,303
  • 1
  • 13
  • 20
0

Switching from iOS simulator to real device solved the problem for me.

stackich
  • 3,607
  • 3
  • 17
  • 41
0

Was facing the same error and solved it ---> Build Settings > Build Active Architecture Only = Yes

Muhammad Haidar
  • 1,541
  • 16
  • 17
-1

Please after adding both framework also open each Bolts and Parse framework and add Parse and Bolts to the project then problem will be solve

  • 1
    Please review [how to write a good answer](http://stackoverflow.com/help/how-to-answer). Please add some references and broaden your explanation. – Quintin Balsdon Dec 20 '16 at 14:04
-1

Running pod update in the root directory of the app fixed the issue for me.

double-beep
  • 5,031
  • 17
  • 33
  • 41
-1

If you are developing one module using cocoapods, try to comment the line

s.vendored_frameworks = "YOURMODULE.framework"

on YOURMODULE.podspec

The error will disappear after you generate and copy your YOURMODULE.framework to your project folder.

Ronaldo Albertini
  • 1,329
  • 20
  • 24
-3

I had this issue on one of the project i worked, before you delete and readd the framework do a:

git status 

on your project and check to see if the framework is not listed as deleted. In the event that it is either do a

git stash 

or

git checkout *framework/file/path*
DvixExtract
  • 1,275
  • 15
  • 25