XCode/PhoneGap - Apple Mach-O 链接器错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18217498/
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
XCode/PhoneGap - Apple Mach-O Linker Error
提问by FlyingLemon
I just finished programming my application. I tried to archive the App for submission, but it didn't work, the following error was displayed. This problem only happens when I want to archive the app, running on Test device or Simulator works perfect(no errors).
我刚刚完成了我的应用程序的编程。我尝试将应用程序存档以进行提交,但没有成功,显示以下错误。此问题仅在我想存档应用程序时发生,在测试设备或模拟器上运行完美(没有错误)。
Ld /Users/Admin/Library/Developer/Xcode/DerivedData/MyApp-ekptdmvfytpoeoaedgfvjzqudoqa/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app/MyApp normal armv7
cd /Users/Admin/Desktop/MyApp3
setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/Admin/Library/Developer/Xcode/DerivedData/MyApp-ekptdmvfytpoeoaedgfvjzqudoqa/Build/Intermediates/ArchiveIntermediates/MyApp/BuildProductsPath/Release-iphoneos -L/Users/Admin/Desktop/MyApp3 -F/Users/Admin/Library/Developer/Xcode/DerivedData/MyApp-ekptdmvfytpoeoaedgfvjzqudoqa/Build/Intermediates/ArchiveIntermediates/MyApp/BuildProductsPath/Release-iphoneos -filelist /Users/Admin/Library/Developer/Xcode/DerivedData/MyApp-ekptdmvfytpoeoaedgfvjzqudoqa/Build/Intermediates/ArchiveIntermediates/MyApp/IntermediateBuildFilesPath/MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7/MyApp.LinkFileList -dead_strip -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -force_load /Users/Admin/Library/Developer/Xcode/DerivedData/MyApp-ekptdmvfytpoeoaedgfvjzqudoqa/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/libCordova.a -ObjC -fobjc-link-runtime -miphoneos-version-min=6.1 -lxml2 -lxml2.2 -larchive.2 -framework CoreLocation -framework ImageIO -framework OpenAL -framework AssetsLibrary /Users/Admin/Library/Developer/Xcode/DerivedData/MyApp-ekptdmvfytpoeoaedgfvjzqudoqa/Build/Intermediates/ArchiveIntermediates/MyApp/BuildProductsPath/Release-iphoneos/libCordova.a -framework Foundation -weak_framework UIKit -framework CoreGraphics -framework AddressBook -framework AddressBookUI -framework AudioToolbox -weak_framework AVFoundation -framework CFNetwork -framework MediaPlayer -framework QuartzCore -framework SystemConfiguration -framework MobileCoreServices -weak_framework CoreMedia -framework CoreLocation -lCordova -o /Users/Admin/Library/Developer/Xcode/DerivedData/MyApp-ekptdmvfytpoeoaedgfvjzqudoqa/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app/MyApp
ld: file not found: /Users/Admin/Library/Developer/Xcode/DerivedData/MyApp-ekptdmvfytpoeoaedgfvjzqudoqa/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/libCordova.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
(null): File not found: /Users/Admin/Library/Developer/Xcode/DerivedData/Myapp-ekptdmvfytpoeoaedgfvjzqudoqa/Build/Intermediates/ArchiveIntermediates/Myapp/InstallationBuildProductsLocation/Applications/libCordova.a
(null): Linker command failed with exit code 1 (use -v to see invocation)
I already googled the ** out of this the past days. I tried everything I found. I set Build Active Architecture Only to "YES", deleted search paths (they were already empty), changed iOS Version, set Validate Build Product and other stuff.
过去几天我已经用谷歌搜索了**。我尝试了我发现的一切。我将 Build Active Architecture Only 设置为“YES”,删除了搜索路径(它们已经是空的),更改了 iOS 版本,设置了 Validate Build Product 和其他东西。
I create my projects using terminal and ./create.
我使用终端和 ./create 创建我的项目。
I even made a new clean projectand posted my source code in there. The problem occures every time (even if I try to archive the new project without changing anything in source)
我什至创建了一个新的干净项目并将我的源代码发布在那里。每次都会出现问题(即使我尝试存档新项目而不更改源代码中的任何内容)
Using: XCode 4.6.3 PhoneGap 2.9.0
使用:XCode 4.6.3 PhoneGap 2.9.0
I am desperate and hope for help. Thank you.
我很绝望,希望得到帮助。谢谢你。
回答by FlyingLemon
SOLUTION
解决方案
I found a solution/work-around. (Couldn't post it because if 10Rep. limit, had to wait 8 hours)
我找到了解决方案/变通方法。(无法发布,因为如果 10Rep. 限制,必须等待 8 小时)
- In Target's Build Settings, find "Other Linker Flags"
- Change $(TARGET_BUILD_DIR)/libCordova.a
- To $(BUILT_PRODUCTS_DIR)/libCordova.a
- 在 Target 的 Build Settings 中,找到“Other Linker Flags”
- 更改 $(TARGET_BUILD_DIR)/libCordova.a
- 到 $(BUILT_PRODUCTS_DIR)/libCordova.a
Orjust go to the Cordova site and download Cordova 3.0.0(although the old known "splashscreen - white flash" is back)
或者只是去 Cordova 站点并下载Cordova 3.0.0 (虽然旧的已知的“splashscreen - white flash”又回来了)
With Cordova 3.0this problem is fixed:) Archiving worksfine.
随着科尔多瓦3.0这个问题是固定的:)归档工作的罚款。
回答by swickaphil
I am having the same issue... Works fine on simulator and test device, set Build Active Architecture to "YES" on both Cardova and MyApp projects, created using terminal ./create, rebuild the project from scratch. Using: XCode 4.6.3 PhoneGap 2.9.0
我遇到了同样的问题......在模拟器和测试设备上工作正常,在 Cardova 和 MyApp 项目上将 Build Active Architecture 设置为“YES”,使用终端 ./create 创建,从头开始重建项目。使用:XCode 4.6.3 PhoneGap 2.9.0
Update: Rebuilt my project with PhoneGap 3.0.0 and am now able to archive.
更新:使用 PhoneGap 3.0.0 重建我的项目,现在可以存档。
回答by Ian Jamieson
For me this was solved by setting "Build Active Architecture Only" to "Yes" for the "Release" setting in your Build Settings in xcode.
对我来说,这是通过在 xcode 的构建设置中将“仅构建活动架构”设置为“是”来解决的。
The fix described by FlyingLemon had already been done as I have the latest version of PhoneGap.
FlyingLemon 描述的修复已经完成,因为我拥有最新版本的 PhoneGap。
Phonegap version 3.4.0-0.19.13
Phonegap 版本 3.4.0-0.19.13
Xcode version 5.1
Xcode 5.1 版