I've been struggling with this for a few days now. When I create a new Static Library project under IOS in XCode 4 I am running into an issue. With or without adding files as headers or to be compiled I am able to successfully build but the .a file is always red. This happens in both Debug and Release. I've read about similar issues but haven't found someone who has fixed the problem. Any help would be appreciated. Thanks
Asked
Active
Viewed 5,593 times
2 Answers
26
XCode seems to have a bug in this regard when building for the simulator. Build once for device, right-click the library to show in finder, back up a level, and navigate to the simulator one. Your library will be there. (The path will look something like this: /Users/You/Library/Developer/Xcode/DerivedData/LibName-fylbqugtzucxyndtdddrjmbbdnet/Build/Products/Debug-iphonesimulator)

James
- 863
- 8
- 21
-
1This is a separate bug I think - like the OP, I CANNOT get either device OR simulator to stop being red :(. – Adam Jun 28 '12 at 11:30
-
3Building for device fixed it for me. On some of the sub-static libraries, I had to build from their schemes for device to make it work. – migs647 Apr 04 '14 at 17:35
-
You saved my day!! Build for device is fine, but for simulator I'm still getting linking errors. – Sikander Dec 16 '15 at 08:02
-
2Amazing that we are now on XCode 7.2 and this is still an issue – Ryan Heitner Feb 05 '16 at 14:02
2
I wasn't able to figure out the answer to this problem but I did find a work around. I installed the XCode 4 project template to build universal frameworks from https://github.com/kstenerud/iOS-Universal-Framework. This allowed me to build a framework which fit my needs.

Phil
- 521
- 1
- 5
- 14