简体   繁体   中英

Apple Mach-O Linker error

I'm using Xcode 5 . I can build and simulate my app, but when I archive my app I receive this eror:

"Apple Mach-O linker Error Linker Command Failed with exit code 1."

Ld /Users/skyline/Library/Developer/Xcode/DerivedData/cityscape45-caolbyqfojifkfgusooirnhrplqi/Build/Intermediates/ArchiveIntermediates/cityscape45/InstallationBuildProductsLocation/Applications/cityscape45.app/cityscape45 normal armv7 cd /Users/skyline/Desktop/cityscape setenv IPHONEOS_DEPLOYMENT_TARGET 7.0 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/iPhoneOS7.0.sdk -L/Users/skyline/Library/Developer/Xcode/DerivedData/cityscape45-caolbyqfojifkfgusooirnhrplqi/Build/Intermediates/ArchiveIntermediates/cityscape45/BuildProductsPath/Distribution-iphoneos -F/Users/skyline/Library/Developer/Xcode/DerivedData/cityscape45-caolbyqfojifkfgusooirnhrplqi/Build/In termediates/ArchiveIntermediates/cityscape45/BuildProductsPath/Distribution-iphoneos -filelist /Users/skyline/Library/Developer/Xcode/DerivedData/cityscape45-caolbyqfojifkfgusooirnhrplqi/Build/Intermediates/ArchiveIntermediates/cityscape45/IntermediateBuildFilesPath/cityscape45.build/Distribution-iphoneos/cityscape45.build/Objects-normal/armv7/cityscape45.LinkFileList -dead_strip -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -force_load /Users/skyline/Library/Developer/Xcode/DerivedData/cityscape45-caolbyqfojifkfgusooirnhrplqi/Build/Intermediates/ArchiveIntermediates/cityscape45/BuildProductsPath/Distribution-iphoneos/libCordova.a -ObjC -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -framework AssetsLibrary /Users/skyline/Library/Developer/Xcode/DerivedData/cityscape45-caolbyqfojifkfgusooirnhrplqi/Build/Intermediates/ArchiveIntermediates/cityscape45/BuildProductsPath/Release-iphoneos/libCordova.a -fr amework CoreGraphics -framework MobileCoreServices -framework CoreLocation -Xlinker -dependency_info -Xlinker /Users/skyline/Library/Developer/Xcode/DerivedData/cityscape45-caolbyqfojifkfgusooirnhrplqi/Build/Intermediates/ArchiveIntermediates/cityscape45/IntermediateBuildFilesPath/cityscape45.build/Distribution-iphoneos/cityscape45.build/Objects-normal/armv7/cityscape45_dependency_info.dat -o /Users/skyline/Library/Developer/Xcode/DerivedData/cityscape45-caolbyqfojifkfgusooirnhrplqi/Build/Intermediates/ArchiveIntermediates/cityscape45/InstallationBuildProductsLocation/Applications/cityscape45.app/cityscape45

ld: file not found: /Users/skyline/Library/Developer/Xcode/DerivedData/cityscape45-caolbyqfojifkfgusooirnhrplqi/Build/Intermediates/ArchiveIntermediates/cityscape45/BuildProductsPath/Distribution-iphoneos/libCordova.a clang: error: linker command failed with exit code 1 (use -v to see invocation)

Please help. Thanks!

The issue is in the last line of the Linker Error description:

ld: file not found : /Users/skyline/Library/.../ libCordova.a clang: error: linker command failed with exit code 1 (use -v to see invocation)

You may only see this error when archiving because an Archive build may use the Release build settings, as opposed to the Debug build settings.

Ensure that your library, libCordova.a , is properly linked in the build settings (specifically, "Other Linker Flags"). Also check your build phases to see if it is being copied with your product.

It looks like this other Stack Overflow answer should provide a solution for you. This SO post may also be useful . If those don't help, a quick google search for "ld file not found Xcode 5" turns up lots of results.

通过首先与XCode分开构建CordovaLib项目,然后构建我的项目,我能够解决此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM