How to "add existing frameworks" in Xcode 4?

XcodeFrameworksXcode4

Xcode Problem Overview


I can't find the good old "Add existing frameworks" option. How do I do this?

We're talking about Xcode 4 DP2 (in the context of iPhone development, as far as it matters...).

Xcode Solutions


Solution 1 - Xcode

As per Apple's documentation:

  1. In the project navigator, select your project.
  2. Select your target.
  3. Select the "Build Phases" tab.
  4. Open "Link Binaries With Libraries" expander.
  5. Click the + button.
  6. Select your framework.
  7. (optional) Drag and drop the added framework to the "Frameworks" group.

Solution 2 - Xcode

I just added the existing framework folder manually into the project navigator. Worked for me.

Solution 3 - Xcode

Follow below 5 steps to add framework in your project.

  1. Click on Project Navigator.
  2. Select Targets (Black arrow in the below image).
  3. Select Build phases ( Blue arrow in the below image).
  4. Click on + Button (Green arrow in below image).
  5. Select your framework from list.

Framework

Here is the official Apple Link

Solution 4 - Xcode

Another easy way to do it so that it is referenced in the project folder you want, like "Frameworks", is to:

  1. Select "Show the Project navigator"
  2. Right-click on the project folder you wish to add the framework to.
  3. Select 'Add Files to "YourProjectName"'
  4. Browse to the framework - generally under /Developer/SDKs/MacOSXversion.sdk/System/Library/Frameworks
  5. Select the one you want.
  6. Select "Add"

It will appear in both the project navigator where you want it, as well as in the "Link Binary With Libraries" area of the "Build Phases" pane of your target.

Solution 5 - Xcode

The frameworks directory is as follow in my computer: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks

not the directory

/Developer/SDKs/MacOSXversion.sdk/System/Library/Frameworks

Solution 6 - Xcode

In Project

  1. Select the project navigator
  2. Click on Build Phases
  3. Click on link binary with libraries
  4. Click on + Button and add your Frameworks

Solution 7 - Xcode

Follow the screen shots

Go to linked framework and libraries

enter image description here

you are ready to Go!

Solution 8 - Xcode

  1. In the project navigator, select your project.

  2. Select your target.

  3. Select the "Build Phases" tab.

  4. expander. Click the + button.

  5. Select your framework.

  6. (optional) Drag and drop the added framework to the "Frameworks" group.

enter image description here

Solution 9 - Xcode

Xcode 12

Just drag it into the Frameworks, Libraries, and Embedded Content of the General section of the Target:

enter image description here Done!

Note that Xcode 11 and 10 have a very similar flow too.

Solution 10 - Xcode

Starting Xcode v11 you should use

<Project settings> -> <App Target> -> Frameworks, Libraries, and Embedded Content
//or
<Project settings> -> <Framework Target> -> Frameworks and Libraries

[Frameworks, Libraries, and Embedded Content plus Frameworks and Libraries with Embed vs Do Not Embed]

Also do not forget to check Library Search Paths or Framework Search Paths. I would recommend you to use drag-and-drop[About]

[Step-by-step examples here]

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
QuestionAriel MalkaView Question on Stackoverflow
Solution 1 - XcodeCyberView Answer on Stackoverflow
Solution 2 - XcodeTom WilkeView Answer on Stackoverflow
Solution 3 - XcodeHemant Singh RathoreView Answer on Stackoverflow
Solution 4 - XcodeGTAE86View Answer on Stackoverflow
Solution 5 - XcodermlView Answer on Stackoverflow
Solution 6 - XcodesabirView Answer on Stackoverflow
Solution 7 - XcodeTunvir Rahman TusherView Answer on Stackoverflow
Solution 8 - XcodeSARATH SASIView Answer on Stackoverflow
Solution 9 - XcodeMojtaba HosseiniView Answer on Stackoverflow
Solution 10 - XcodeyoAlex5View Answer on Stackoverflow