Xcode 4.5 no such file or directory - libCordova.a

2019-02-05 14:01发布

clang: error: no such file or directory: '/Users/admin/Library/Developer/Xcode/DerivedData/__TESTING__-fzbkvdbnndieeagphtjhdndiyttl/Build/Products/Debug-iphoneos/libCordova.a'

How do I get this a missing libCordova.a ?

align top http://www.kerrydeaf.com/libCordova.a.png

UPDATE: For Simon Germain. align top http://www.kerrydeaf.com/update.png

UPDATE: For Simon Germain. I don't see "Identity and Type". I can see "Identity". I'm using xcode 4.5 align top http://www.kerrydeaf.com/id.png

align top http://www.kerrydeaf.com/update.png

UPDATE: For Simon Germain. I got the Identity.

align top http://www.kerrydeaf.com/cor.png

UPDATE: For Samuel

align top http://www.kerrydeaf.com/armv6.png

UPDATE: For Simon Germain - Architecture.

UPDATE: For james0n - armv.

align top http://www.kerrydeaf.com/new.png

UPDATE: For Simon Germain - Architecture.

UPDATE: For james0n - armv.

 Undefined symbols for architecture i386:
   "_OBJC_CLASS_$_CDVURLProtocol", referenced from:
       objc-class-ref in AppDelegate.o
   "_OBJC_CLASS_$_CDVViewController", referenced from:
       _OBJC_CLASS_$_MainViewController in MainViewController.o
   "_OBJC_METACLASS_$_CDVViewController", referenced from:
       _OBJC_METACLASS_$_MainViewController in MainViewController.o
 ld: symbol(s) not found for architecture i386
 clang: error: linker command failed with exit code 1 (use -v to see invocation)

UPDATE: For james0n - Valid Architecture.

align top http://www.kerrydeaf.com/valid.png

UPDATE: It is now solved!!! make sure all armv7 and armv7s for ios 6 on all in xcode. It worked.

标签: xcode ios6
12条回答
手持菜刀,她持情操
2楼-- · 2019-02-05 14:33

Only need to remove armv6 from both YourProject and CordovaLib: remove armv6 from CordovaLib and do the same for YourProject

The consequences of doing this? Apparently, it's still working on iPhone 3GS, but not the previous versions..

查看更多
萌系小妹纸
3楼-- · 2019-02-05 14:33

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

enter image description here

查看更多
对你真心纯属浪费
4楼-- · 2019-02-05 14:37

Make sure that the CordovaLib's product's target is set to "Relative to Built Product" on the right hand-side panel, first tab on theleft, under "Identity and Type".

enter image description here

查看更多
可以哭但决不认输i
5楼-- · 2019-02-05 14:38

After spending many hours with even more errors, here's what worked for me. Basically combining much of the above:

  1. Start with a fresh copy of Cordova. If you've been messing with it like me, it's not fresh anymore.
  2. Move the Cordova files out of the download directory (I tend to clean that directory now and then...)
  3. Create a new project as described in the Phonegap docs, i.e. drag the ios/bin folder to the Terminal icon and run the create script in Terminal. No need to run the update_cordova_subproject script.
  4. Open the project in XCode.
  5. For your product, set the iOS Deployment Target to 4.3 (I did it 2x, both in Project and Target Build Settings).
  6. For CordovaLib.xcodeproj, set Build for Active Architecture to Yes in the Project Build Settings.
  7. Clean and run.

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.)

查看更多
劫难
6楼-- · 2019-02-05 14:38

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

查看更多
做自己的国王
7楼-- · 2019-02-05 14:40

I had the same problem as you, worked fine deployed to the simulators but not to a device. Neither of the suggested answers worked for me.

Here's what did work for me:

Set deployment target to v4.3 and on the project settings for the CordovaLib project, set the Build Active Architecture Only to Yes. (Not needed on your main project).
Important, do a Product-> Clean and rebuild.

查看更多
登录 后发表回答