XCode/PhoneGap - Apple Mach-O Linker Error

匿名 (未验证) 提交于 2019-12-03 02:53:02

问题:

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.

I create my projects using terminal and ./create.

I even made a new clean project and 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

I am desperate and hope for help. Thank you.

回答1:

SOLUTION

I found a solution/work-around. (Couldn't post it because if 10Rep. limit, had to wait 8 hours)

  • In Target's Build Settings, find "Other Linker Flags"
  • Change $(TARGET_BUILD_DIR)/libCordova.a
  • To $(BUILT_PRODUCTS_DIR)/libCordova.a

Or just go to the Cordova site and download Cordova 3.0.0 (although the old known "splashscreen - white flash" is back)

With Cordova 3.0 this problem is fixed :) Archiving works fine.



回答2:

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

Update: Rebuilt my project with PhoneGap 3.0.0 and am now able to archive.



回答3:

For me this was solved by setting "Build Active Architecture Only" to "Yes" for the "Release" setting in your Build Settings in xcode.

The fix described by FlyingLemon had already been done as I have the latest version of PhoneGap.

Phonegap version 3.4.0-0.19.13

Xcode version 5.1



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!