clang: error: no such file or directory: \'/Users/admin/Library/Developer/Xcode/DerivedData/__TESTING__-fzbkvdbnndieeagphtjhdndiyttl/Build/Products/Debug-iphoneos/li
In addition to several other suggestions & post, I found that I was experiencing this problem on my AdHoc builds only. Please note that I figured this out during debugging because if I set the Edit Scheme > Archive build configuration to "release" it would work OK, but if set to AdHoc it would give me a link error, telling me that this file could not be found:
/Users/jason/Library/Developer/Xcode/DerivedData/MommyNearest-ceourmykvgxdekbkmzenuvhcfnzk/Build/Intermediates/ArchiveIntermediates/MommyNearest/BuildProductsPath/Adhoc-iphoneos/libCordova.a
This was actually a good clue to what the problem was, which was that somehow the CordovaLib subproject did not have an AdHoc configuration (it had ONLY "Debug" and "Release" configurations).
Therefore, when building for an AdHoc release (to use with Testflight) it would not create a symlink for this file correctly. Once I added an "AdHoc" configuration to the CordovaLib subproject, this started working.
Had (as many others) the same problem, here's what I did:
Architectures: Standard (armv7, armv7s)
Build Active Architecture only: Yes
and then it magically worked, I think steps 3 and 4 did it however.
After spending many hours with even more errors, here's what worked for me. Basically combining much of the above:
Do not include armv7s in any of the architecture lists, as it will not build for device.
Tested in simulator and on an iPad with iOS 6. Using Phonegap 2.1.0 and XCode 4.5.1.
Update: if you want to support iPhone 5, you will need armv7s. It requires the fix in https://issues.apache.org/jira/browse/CB-1360 , which will be in Cordova 2.2.0. (Haven't tried it yet, working on an iPad project.)
Also - make sure you don't have more than one PhoneGap Xcode project open at a time - I was getting conflicts between the two. "Workspace already open in another workspace" type of loop.
I had this problem too. I think it was because I had previously installed an old version of phone gap that installed some stuff in xcode. I uninstalled, then reinstalled xcode. Then I ran the Uninstall Cordova.applescript that came with phone gap. This fixed the problem of the red libCordova.a
You gotta run the update script, I know it might be a pain in the butt to do it, but that's what it takes.
Download and open the Phonegap 2.1 package from the official site. Open a terminal window, and cd to the installation directory
You'll need to first create a new project:
./create [project_folder_path] [package_name] [project_name]
Then you need to set the path to your libraries.
/update_cordova_subproject [xcodeproj file]
Now open up your project and set the deployment target to 4.3 and you should be ready to go. Hope that helps
EDIT:
This is how my configuration looks like for CordovaLib Project