xcode PhoneGap 2.9 中缺少 libCordova.a 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17401478/
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
libCordova.a file missing in PhoneGap 2.9
提问by Mehdi
Can you plz help me? I am using XCode version 4.6.3 and phonegap version 2.9. The project is running fine in Simulator but when I want to make a IPA file, it always build failed.
你能帮我吗?我使用的是 XCode 4.6.3 版和 phonegap 2.9 版。该项目在模拟器中运行良好,但是当我想制作 IPA 文件时,它总是构建失败。
The message is showing like below:
消息显示如下:
file not found: /Users/admin/.../libCordova.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have found some discussion on this issue. Most of the solution is like (1) to change the BUILD ACTIVE ARCHITECTURE ONLY to YES, (2) to change the ARCHITECTURE only to armv7, (3) update the project after creating it...etc. But none of those working for me.
我发现了一些关于这个问题的讨论。大多数解决方案类似于(1)将 BUILD ACTIVE ARCHITECTURE ONLY 更改为 YES,(2)仅将 ARCHITECTURE 更改为 armv7,(3)在创建项目后更新项目......等。但没有一个对我来说有效。
Plz help anyway.
无论如何请帮忙。
Thanks in advance.
提前致谢。
回答by Prem
Follow these steps to fix this problem:
请按照以下步骤解决此问题:
- Go to project settings and Build Tab. Search for "Other Linker Flags"
- Double click on the linker flags for Release and Change
${TARGET_BUILD_DIR}/libCordova.a
to${BUILT_PRODUCTS_DIR}/libCordova.a
- Do the same for Debug
- Clean and build archive again
- 转到项目设置和构建选项卡。搜索“其他链接器标志”
- 双击用于发布和更改
${TARGET_BUILD_DIR}/libCordova.a
为的链接器标志${BUILT_PRODUCTS_DIR}/libCordova.a
- 对 Debug 执行相同操作
- 再次清理并构建存档
回答by Chris Conway
If Prems answer doesn't fix the issue, try building your CordovaLib project first. After doing that I was able to build my project.
如果 Prems 的回答没有解决问题,请先尝试构建您的 CordovaLib 项目。这样做之后,我能够构建我的项目。
回答by Jason FB
In addition to several other suggestions & post, I found that I was experiencing this problem on my AdHoc builds only.
除了其他一些建议和帖子之外,我发现我仅在我的 AdHoc 构建中遇到了这个问题。
The problem for me was the the CordovaLib subproject did not have an AdHoc configuration. Once I added an "AdHoc" configuration to the CordovaLib subproject, this started working.
我的问题是 CordovaLib 子项目没有 AdHoc 配置。一旦我向 CordovaLib 子项目添加了“AdHoc”配置,它就开始工作了。
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:
请注意,我在调试期间发现了这一点,因为如果我将 Edit Scheme > Archive build configuration 设置为“release”它会正常工作,但是如果设置为 AdHoc 它会给我一个链接错误,告诉我这个文件不能成立:
/Users/jason/Library/Developer/Xcode/DerivedData/MommyNearest-ceourmykvgxdekbkmzenuvhcfnzk/Build/Intermediates/ArchiveIntermediates/MommyNearest/BuildProductsPath/Adhoc-iphoneos/libCordova.a
/Users/jason/Library/Developer/Xcode/DerivedData/MommyNearest-ceourmykvgxdekbkmzenuvhcfnzk/Build/Intermediates/ArchiveIntermediates/MommyNearest/BuildProductsPath/Adhoc-iphoneos/libCordova.a
回答by maridob
If you check the linker suggestion above and still not working. Make sure that Cordova project has the same configuration name. If your main project has "Debug, Release, and Production" configurations. Add same configurations in the Cordova project. Build Cordova and then build your project.
如果您检查了上面的链接器建议但仍然无法正常工作。确保 Cordova 项目具有相同的配置名称。如果您的主项目具有“调试、发布和生产”配置。在 Cordova 项目中添加相同的配置。构建 Cordova,然后构建您的项目。
回答by orioncabbar
I you are using Xcode 5.0, do exactly the opposite and it works.
我使用的是 Xcode 5.0,正好相反,它可以工作。