0
votes

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/Intermediates/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 -framework 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!

2

2 Answers

0
votes

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.

0
votes

I was able to solve this issue by first building the CordovaLib project separately from within XCode and then building my project.