How to "add existing frameworks" in Xcode 4?
Solution 1
- In the project navigator, select your project.
- Select your target.
- Select the "Build Phases" tab.
- Open "Link Binaries With Libraries" expander.
- Click the + button.
- Select your framework.
- (optional) Drag and drop the added framework to the "Frameworks" group.
Solution 2
I just added the existing framework folder manually into the project navigator. Worked for me.
Solution 3
Follow below 5 steps to add framework in your project.
- Click on Project Navigator.
- Select Targets (Black arrow in the below image).
- Select Build phases ( Blue arrow in the below image).
- Click on + Button (Green arrow in below image).
- Select your framework from list.
Here is the official Apple Link
Solution 4
Another easy way to do it so that it is referenced in the project folder you want, like "Frameworks", is to:
- Select "Show the Project navigator"
- Right-click on the project folder you wish to add the framework to.
- Select 'Add Files to "YourProjectName"'
- Browse to the framework - generally under /Developer/SDKs/MacOSXversion.sdk/System/Library/Frameworks
- Select the one you want.
- 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
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
Ariel Malka
Freelance mobile developer (iPhone, Android) based in Tel-Aviv and focusing on Software Architecture, UI, interactivity, 2D/3D Computer Graphics and gaming...
Updated on July 19, 2022Comments
-
Ariel Malka almost 2 years
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...).
-
Considerate about 13 yearsI would like to point out that if you can't find "Link Binaries With Libraries" in your build phases tab click the "Add build phase" button in the lower right corner.
-
Shivan Dragon over 11 yearsI can't believe that: a. there's a (integrated, none the less) IDE+SDK out there in 2012 that still doesn't make clear how to add one of the bundled frameworks to a project. b. such a (normally) trivial subject got so much attention. c. the solution in so convoluted.
-
wkw over 11 yearsI kept right-clicking the Frameworks folder in my project figuring there should be a contextual menu item there for this; there isn't, and xcode, somewhat like the over-extended iTunes app, is often not consistent, logical or intuitive. Sadly, with my xCode version (4.4), using help menu search crashed the app just as the relevant help page came up. I'm one update behind the latest xCode release, but switching horses with an overdue deadline seems like a bad idea (even though I hope they fixed the "help" crashing in the update)
-
-
Ariel Malka almost 14 yearsOk, I finally did it, as follows: 1) In the "project navigator", open the "frameworks" folder and select one the existing frameworks (e.g. UIKit.framework) 2) Right click and select "Show in Finder" from the menu 3) From the newly opened folder in the finder, drag the framework folder you are interested in (e.g. OpenGLES.framework) into the "frameworks" folder in XCode 4) Be sure not to "copy items into destination's group folder" 5) Choosing "Create groups for any added folders" seems to make it
-
mk12 almost 14 yearsFor me at least, if you move the framework into any of the groups after this, it stops working.
-
memmons about 13 yearsI just tried this with the latest build and didn't have any issues with moving the framework to the Frameworks group after it was added to the build.
-
vivianaranha about 13 yearsThey have made this so dumb... I think I kinda miss the old XCode... So many chnages... even some shortcuts dont work :P
-
samwize about 13 yearsIf i have 2 targets, then i have to add 2 times?
-
Hanuman about 13 years@vivianaranha, me too missing the old Xcode... xcode 4 crashes most of the time for me..
-
Kalle about 13 yearsCompare "right click, add, existing framework" to the above and yeah, no wonder people miss old Xcode. Why're they complicating stuff? baffled (+1 for answer, not that you need it with 131 +'es already but hey! :P)
-
Erik S about 13 yearsSame, lots of crashes. I really like most of the new stuff they added, as it makes stuff a lot clearer. It just needs some heavy development... let's hope the next version will be great ;)
-
Wayne Lo about 13 yearsThe learning curve from xCode 3 to 4 is high. Hard not to swear at the Apple engineering team when our projects are over due. Thank you for helping relieve this stress.
-
Sadat about 13 years@Cyber, adding a target dependency should ask for recursive option. At the first time it asked me for recursive option in a project. Then I have created a new project and tried it there, but its not asking! Even if I remove the dependency from the first project(where recursive option was asked), and try to add again, its not asking for recursive option!! whats wrong here? I am using xcode4. thanks.
-
ma11hew28 about 13 yearsIf you move the framework into any of the groups after this, it may turn red, but just leave and go back to the view and it went back to green for me.
-
chunkyguy about 13 yearsI like xcode 4, I know its gonna take time to switch, but you all will love it when you're used to it, be patient with learning :) Cheers
-
swdev about 13 yearsI am new to xcode, and just having problem with this, because the tutorial use xcodd 3 (I think). +1 for the steps
-
theiOSDude almost 13 yearsthis is crap - just like the debugging in xcode 4. +1 for your info, very helpful
-
Imran Raheem over 12 yearsWhat if i have multiple targets in my project and I want to add a framework to all these targets at once?
-
Zigglzworth over 12 yearsWell done Apple instead of making it easy with a simple CNTRL-click on Frameworks, you've added a colorful array of unnecessary steps.
-
user102008 over 12 yearsthis places the framework as the first thing under your project, not in your Frameworks folder. if you try to drag it into your Frameworks folder, it will only allow it to be inserted at the top, not in the middle or the bottom. why?
-
leolobato over 12 yearsIf you need to add the same framework to multiple targets, add for the first one and then drag the framework from the navigator tree into 'Link Binary With Libraries' build phase for the other targets.
-
Valerii Pavlov over 12 yearsWhen i drag'n'drop framework in Frameworks folder (7 step) its missing from 'Link Binaries With Libraries' expander :) Epic xcode 4.2 fail! To fix that u must again drag'n'drop it from Frameworks to 'Link Binaries With Libraries' expander area
-
OnTheEasiestWay over 12 yearsFor step 7: Do not worry if framework's name turns red in the 'Link Binary With Libraries' section after you move it - this is only temporary. In my case, quit and enter XCode will show it correctly. I have to say 'I HATE it!'
-
GTAE86 almost 12 yearsRight - it depends on what you have installed. Also, the XCode 4.3 release causes them to be installed to a completely new location - under the XCode distribution path. On my two machines, it is: /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/SDKs/MacOSX10.7.sdk/system/Library/Frameworks