简体   繁体   English

使用 phonegap v 2.9 为 Xcode 4.6 版本构建存档失败

[英]Building an archive for Xcode 4.6 release with phonegap v 2.9 fails

This appears to be a recurring phenomena.这似乎是一个反复出现的现象。

I saw a number of prior questions, where the solution was to delete armv6, and then the archive would work.我看到了一些先前的问题,解决方案是删除 armv6,然后存档就可以工作了。 Of course, armv6 is gone.当然,armv6 没了。

So, now, building with both current, Xcode 4.6.3 phonegap 2.9.所以,现在,使用当前的Xcode 4.6.3 phonegap 2.9 构建。 And yes, the app works fine on iphones, ipads, and in the simulator.是的,该应用程序在 iphone、ipad 和模拟器上运行良好。

I get this message at the end of the create archive step:我在创建存档步骤结束时收到此消息:

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/BuildProductsPath/Release-iphoneos -F/Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/BuildProductsPath/Release-iphoneos -filelist /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/IntermediateBuildFilesPath/peeq.build/Release-iphoneos/peeq.build/Objects-normal/armv7s/peeq.LinkFileList -dead_strip -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -force_load /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/InstallationBuildProductsLocation/Applications/libCordova.a -ObjC -fobjc-link-runtime -miphoneos-version-min=5.0 -framework CoreLocation -framework ImageIO -framework OpenAL -framework AssetsLibrary /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/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 -o /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/IntermediateBuildFilesPath/peeq.build/Release-iphoneos/peeq.build/Objects-normal/armv7s/peeq

ld: file not found: /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/InstallationBuildProductsLocation/Applications/libCordova.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)

And went over and looked around the file system there:然后走过去环顾那里的文件系统:

cd /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build
./Intermediates/ArchiveIntermediates/peeq/BuildProductsPath/Release-iphoneos/libCordova.a
./Intermediates/ArchiveIntermediates/peeq/IntermediateBuildFilesPath/CordovaLib.build/Release-iphoneos/CordovaLib.build/Objects-normal/armv7/libCordova.a
./Intermediates/ArchiveIntermediates/peeq/IntermediateBuildFilesPath/CordovaLib.build/Release-iphoneos/CordovaLib.build/Objects-normal/armv7s/libCordova.a
./Intermediates/ArchiveIntermediates/peeq/IntermediateBuildFilesPath/UninstalledProducts/libCordova.a

And it's been built, just not put where the linker wanted to find it.它已经构建好了,只是没有放在链接器想要找到的地方。

So, no doubt some build setting either tells the linker to look there, or tells the build to put it where the linker wants to find it.因此,毫无疑问,某些构建设置要么告诉链接器在那里查找,要么告诉构建将它放在链接器想要找到的位置。

Unless it's something else.除非是别的东西。

My question is how to get the app archive to build correctly, so it can go off to the store.我的问题是如何正确构建应用程序存档,以便它可以发送到商店。


A fine person who works at Apple told me where to look, at which point, this was solved.一个在 Apple 工作的好人告诉我在哪里看,到那时,这个问题就解决了。

Deep within the Build Settings, there is a field to be set, called Other Linker Flags在 Build Settings 的深处,有一个字段需要设置,称为 Other Linker Flags

It starts out showing no value, but if you click on it, it pops up with Debug and Release.它开始时没有显示任何值,但是如果您单击它,它会弹出 Debug 和 Release。

In the very long string that is Release, one finds a -force_load libCordova.a在很长的 Release 字符串中,找到一个 -force_load libCordova.a
and deletes that part of the string.并删除字符串的那部分。

From:从:

-weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -force_load ${TARGET_BUILD_DIR}/libCordova.a -ObjC

To:到:

-weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem  -ObjC

Its probably a bug in some fashion that phonegap defaults this in place, I shall also contact them and see if it can default repair it.它可能是某种方式的错误,phonegap 将其默认设置到位,我也会联系他们,看看它是否可以默认修复它。

His note that pointed me at it:他指出我的笔记:

I notice that your link command contains both this:我注意到您的链接命令包含以下内容:

-force_load /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/InstallationBuildProductsLocation/Applications/libCordova.a

and this:和这个:

/Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/BuildProductsPath/Release-iphoneos/libCordova.a

The path being passed to -force_load is the bogus path that the linker is complaining about.传递给 -force_load 的路径是链接器抱怨的虚假路径。 I think that you need to remove the “-force_load” linker flag.我认为您需要删除“-force_load”链接器标志。 Do you have such a flag set in the “Other Linker Flags” setting?您是否在“其他链接器标志”设置中设置了这样的标志?

Found a fix.找到了解决办法。

  1. In your Target's Build Settings, find Other Linker Flags在目标的构建设置中,找到Other Linker Flags
  2. Change $(TARGET_BUILD_DIR)/libCordova.a更改$(TARGET_BUILD_DIR)/libCordova.a
  3. To $(BUILT_PRODUCTS_DIR)/libCordova.a$(BUILT_PRODUCTS_DIR)/libCordova.a

It's does not works for me to change to "$(BUILT_PRODUCTS_DIR)/libCordova.a" in "Other Linker Flags".在“其他链接器标志”中更改为“$(BUILT_PRODUCTS_DIR)/libCordova.a”对我来说不起作用。 The problem still exist.问题仍然存在。 (Xcode 4.6.3 phonegap 2.9.0) (Xcode 4.6.3 phonegap 2.9.0)

So, I try the setting below and it works for me.所以,我尝试下面的设置,它对我有用。

  1. In your Target's Build Settings, find "Other Linker Flags"在目标的构建设置中,找到“其他链接器标志”
  2. Delete "$(TARGET_BUILD_DIR)/libCordova.a"删除“$(TARGET_BUILD_DIR)/libCordova.a”
  3. Change "-force_load" to "-all_load"将“-force_load”更改为“-all_load”

This did the trick for me.这对我有用。

======== Update ============ ======== 更新 ============

With the above trick, I can achieve the app and submit to App Store with no issue.通过上述技巧,我可以实现该应用程序并毫无问题地提交到 App Store。 But I found out in the iTune Connect that it shows "Invalid binary".但是我在 iTune Connect 中发现它显示“无效的二进制文件”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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