Xcode 4.5 没有这样的文件或目录 - libCordova.a

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12716830/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:35:47  来源:igfitidea点击:

Xcode 4.5 no such file or directory - libCordova.a

xcodeios6

提问by Irishgirl

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

clang:错误:没有这样的文件或目录:'/Users/admin/Library/Developer/Xcode/DerivedData/__TESTING__-fzbkvdbnndieeagphtjhdndiyttl/Build/Products/Debug-iphoneos/libCordova.a'

How do I get this a missing libCordova.a?

我如何得到这个缺少的libCordova.a

align top
(source: kerrydeaf.com)

对齐顶部
(来源:kerrydeaf.com

UPDATE: For Simon Germain. align top

更新:对于西蒙·杰曼。 对齐顶部

UPDATE: For Simon Germain. I don't see "Identity and Type". I can see "Identity". I'm using xcode 4.5 align top
(source: kerrydeaf.com)

更新:对于西蒙·杰曼。我没有看到“身份和类型”。我可以看到“身份”。我使用的是 xcode 4.5 (来源:kerrydeaf.com对齐顶部

align top

对齐顶部

UPDATE: For Simon Germain. I got the Identity.

更新:对于西蒙·杰曼。我得到了身份。

align top
(source: kerrydeaf.com)

对齐顶部
(来源:kerrydeaf.com

UPDATE: For Samuel

更新:对于塞缪尔

align top
(source: kerrydeaf.com)

对齐顶部
(来源:kerrydeaf.com

UPDATE: For Simon Germain - Architecture.

更新:对于 Simon Germain - 建筑。

UPDATE: For james0n - armv.

更新:对于 james0n - armv。

align top
(source: kerrydeaf.com)

对齐顶部
(来源:kerrydeaf.com

UPDATE: For Simon Germain - Architecture.

更新:对于 Simon Germain - 建筑。

UPDATE: For james0n - armv.

更新:对于 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.

更新:对于 james0n - 有效架构。

align top
(source: kerrydeaf.com)

对齐顶部
(来源:kerrydeaf.com

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

更新:现在解决了!!!确保所有的 armv7 和 armv7s 都在 xcode 中用于 ios 6。有效。

回答by james0n

For your project, set the build setting "Build Active Architecture Only" to yes.

对于您的项目,将构建设置“仅构建活动架构”设置为是。

(Maybe also set the the Architectures build setting to "Standard (armv7, armv7s)" for CordovaLib project.)

(也许还可以将 CordovaLib 项目的 Architectures 构建设置设置为“Standard (armv7, armv7s)”。)

回答by andy

Had (as many others) the same problem, here's what I did:

有(和其他许多人一样)同样的问题,这就是我所做的:

  1. Redid the Getting Started guide from Phonegap (including downloading and extracting the source again)
  2. Same problem with the HelloWorld app
  3. product - clean
  4. Changed both the 'HelloWorld' and 'CordovaLib'-project(so not the Targets) according to james0n's answer, settings:
  1. 重做Phonegap的入门指南(包括再次下载和解压源)
  2. HelloWorld 应用程序的相同问题
  3. 产品 - 干净
  4. 根据 james0n 的回答,更改了 'HelloWorld' 和 'CordovaLib'-项目(所以不是目标),设置:

Architectures: Standard (armv7, armv7s)

Build Active Architecture only: Yes

架构:标准(armv7、armv7s)

仅构建主动架构:是

and then it magically worked, I think steps 3 and 4 did it however.

然后它神奇地起作用了,我认为第 3 步和第 4 步做到了。

回答by Samuel

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

只需要从 YourProject 和 CordovaLib 中删除armv6从 CordovaLib 中删除 armv6 并对 YourProject 执行相同操作

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

这样做的后果是什么?显然,它仍在 iPhone 3GS 上工作,但不是以前的版本。

回答by Magnus Johansson

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 didwork for me:

这里就是我的工作:

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

将部署目标设置为 v4.3,并在项目的CordovaLib项目设置上,Build Active Architecture OnlyYes. (您的主项目不需要)。
重要的是,做一个产品-> 清理和重建。

回答by Simon Germain

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

确保 CordovaLib 的产品目标设置为右侧面板上的“相对于内置产品”,左侧第一个选项卡,在“身份和类型”下。

enter image description here

在此处输入图片说明

回答by Vinnie

Download the Cordova installer from here http://phonegap.com/download. Make sure it is the same version that you are currently using (ex 2.0).

从这里下载 Cordova 安装程序http://phonegap.com/download。确保它与您当前使用的版本相同(例如 2.0)。

Then mount the dmg found in the ios directory.

然后挂载在ios目录下找到的dmg。

Then run the .pkg installer.

然后运行 ​​.pkg 安装程序。

Restart Xcode.

重新启动Xcode。

回答by ILikeTacos

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

从官方网站下载并打开 Phonegap 2.1 软件包。打开终端窗口,cd到安装目录

You'll need to first create a new project:

您需要先创建一个新项目:

./create [project_folder_path] [package_name] [project_name]

./create [project_folder_path] [package_name] [project_name]

Then you need to set the path to your libraries.

然后,您需要设置库的路径。

/update_cordova_subproject [xcodeproj file]

/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

现在打开你的项目并将部署目标设置为 4.3,你应该准备好了。希望有帮助

EDIT:

编辑:

This is how my configuration looks like for CordovaLib Project

这就是我的 CordovaLib 项目配置的样子

enter image description here

在此处输入图片说明

回答by dijipiji

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.

另外 - 确保您一次打开的 PhoneGap Xcode 项目不超过一个 - 我在两者之间遇到了冲突。“工作区已在另一个工作区中打开”类型的循环。

回答by RonaldPK

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.
  1. 从 Cordova 的新副本开始。如果你像我一样一直在搞乱它,它就不再新鲜了。
  2. 将 Cordova 文件移出下载目录(我倾向于不时清理该目录......)
  3. 按照 Phonegap 文档中的描述创建一个新项目,即将 ios/bin 文件夹拖到终端图标并在终端中运行创建脚本。无需运行 update_cordova_subproject 脚本。
  4. 在 XCode 中打开项目。
  5. 对于您的产品,将 iOS 部署目标设置为 4.3(我在项目和目标构建设置中设置了 2 次)。
  6. 对于 CordovaLib.xcodeproj,在 Project Build Settings 中将 Build for Active Architecture 设置为 Yes。
  7. 清洁并运行。

Do not include armv7s in any of the architecture lists, as it will not build for device.

不要在任何架构列表中包含 armv7s,因为它不会为设备构建。

Tested in simulator and on an iPad with iOS 6. Using Phonegap 2.1.0 and XCode 4.5.1.

在模拟器和带有 iOS 6 的 iPad 上测试。使用 Phonegap 2.1.0 和 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.)

更新:如果你想支持 iPhone 5,你需要 armv7s。它需要在https://issues.apache.org/jira/browse/CB-1360 中进行修复,它将在 Cordova 2.2.0 中。(还没试过,正在做 iPad 项目。)

回答by gheese

I fixed this by removing the armv6 and i386 architecture from Valid Architecture setting

我通过从有效架构设置中删除 armv6 和 i386 架构来解决这个问题