Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/120.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Xcode 5和phonegap:为设备而不是模拟器生成链接器时出错_Ios_Iphone_Xcode_Cordova_Armv7 - Fatal编程技术网

Ios Xcode 5和phonegap:为设备而不是模拟器生成链接器时出错

Ios Xcode 5和phonegap:为设备而不是模拟器生成链接器时出错,ios,iphone,xcode,cordova,armv7,Ios,Iphone,Xcode,Cordova,Armv7,我们的phonegap应用程序为iphone模拟器构建良好,但在iphone上构建应用程序时会生成链接器错误。唯一改变的是安装testflight和一个测试应用程序 我们已经删除了testflight和测试应用程序,但链接器错误仍然存在 有没有办法解决这个问题 我们使用的是xcode 5和phonegap 3.4 错误: ld: warning: ignoring file /Users/c/Library/Developer/Xcode/DerivedData/s-fhgxmhdprdjvwa

我们的phonegap应用程序为iphone模拟器构建良好,但在iphone上构建应用程序时会生成链接器错误。唯一改变的是安装testflight和一个测试应用程序

我们已经删除了testflight和测试应用程序,但链接器错误仍然存在

有没有办法解决这个问题

我们使用的是xcode 5和phonegap 3.4

错误:

ld: warning: ignoring file /Users/c/Library/Developer/Xcode/DerivedData/s-fhgxmhdprdjvwahdbgwuagoragit/Build/Products/Debug-iphoneos/libCordova.a, file was built for archive which is not the architecture being linked (arm64): /Users/c/Library/Developer/Xcode/DerivedData/s-fhgxmhdprdjvwahdbgwuagoragit/Build/Products/Debug-iphoneos/libCordova.a
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_CDVWebViewDelegate", referenced from:
      objc-class-ref in CDVInAppBrowser.o
  "_OBJC_METACLASS_$_CDVViewController", referenced from:
      _OBJC_METACLASS_$_MainViewController in MainViewController.o
  "_OBJC_CLASS_$_CDVPlugin", referenced from:
      _OBJC_CLASS_$_CDVDevice in CDVDevice.o
      _OBJC_CLASS_$_CDVConnection in CDVConnection.o
      _OBJC_CLASS_$_LowLatencyAudio in LowLatencyAudio.o
      _OBJC_CLASS_$_CDVLogger in CDVLogger.o
      _OBJC_CLASS_$_CDVInAppBrowser in CDVInAppBrowser.o
      _OBJC_CLASS_$_InAppPurchase in InAppPurchase.o
  "_OBJC_METACLASS_$_CDVPlugin", referenced from:
      _OBJC_METACLASS_$_CDVDevice in CDVDevice.o
      _OBJC_METACLASS_$_CDVConnection in CDVConnection.o
      _OBJC_METACLASS_$_LowLatencyAudio in LowLatencyAudio.o
      _OBJC_METACLASS_$_CDVLogger in CDVLogger.o
      _OBJC_METACLASS_$_CDVInAppBrowser in CDVInAppBrowser.o
      _OBJC_METACLASS_$_InAppPurchase in InAppPurchase.o
  "_OBJC_CLASS_$_CDVViewController", referenced from:
      _OBJC_CLASS_$_MainViewController in MainViewController.o
      objc-class-ref in CDVDevice.o
  "_CDVLocalNotification", referenced from:
      -[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
  "_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
      _OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
  "_OBJC_CLASS_$_CDVPluginResult", referenced from:
      objc-class-ref in CDVDevice.o
      objc-class-ref in CDVConnection.o
      objc-class-ref in LowLatencyAudio.o
      objc-class-ref in CDVInAppBrowser.o
      objc-class-ref in InAppPurchase.o
  "_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
      _OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
  "_OBJC_CLASS_$_CDVUserAgentUtil", referenced from:
      objc-class-ref in CDVInAppBrowser.o
  "_OBJC_CLASS_$_CDVCommandQueue", referenced from:
      _OBJC_CLASS_$_MainCommandQueue in MainViewController.o
  "_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
      _OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
  "_CDVPluginHandleOpenURLNotification", referenced from:
      -[AppDelegate application:handleOpenURL:] in AppDelegate.o
      -[CDVInAppBrowser openInSystem:] in CDVInAppBrowser.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

似乎我们也无意中升级到了xcode 5.1,导致了这个问题。phonegap 3.4和xcode 5.1不兼容,除非进行一些更改


以下是解决方案:

如果这似乎是一个老生常谈的答案,那么很抱歉,但当我看到链接器错误时,通常会执行以下步骤:

  • 确保您的代码是最新的,包含所有最新的修复程序和版本
  • 确保更新了子模块。在git中:
    git子模块更新--init--recursive
  • 请创建一个清洁构建文件夹:转到产品,将鼠标悬停在“清洁”上,然后同时按(Command+选项),然后单击“清洁构建文件夹”
冲洗并重复


如果有任何模块未正确引用,请转到构建阶段,删除困扰您的模块并重新添加它们

在更新Xcode时会出现此类问题,但您使用的任何第三方工具都可能无法使用此体系结构更新
armv64

因此,在XCode中单击您的项目导航器

单击项目中的
目标
,然后单击项目中的
构建设置

在其中查找有效的体系结构

只需双击它并从中删除
armv64

确保只有armv7和
armv7s

对我来说,这对我很有效

清理并构建您的项目。现在应该可以用了

希望对你有帮助

编辑

现在,从2015年2月1日起,苹果将不允许没有支持arm64架构的应用


因此,请确保所有提交的应用程序都支持arm64。

谢谢,伙计,这是可行的,真的很讨厌苹果的更新。。。同样的事情也发生在Mavericks身上,完全破坏了我的RSA密钥和GCC/命令工具。这对我也很有用。我当时正在使用Cordova 3.6+Xcode 6,并尝试为iPhone 6构建。它在模拟器中工作,但在iPhone6设备上的构建却崩溃了。如上所述卸下armv64修复了该问题。谢谢@曼坦。当我尝试构建xcodeproj文件时,执行上述步骤会导致以下错误。有什么想法吗?运行MacOSX10.9.5(约塞米蒂)
无需编译架构(只有_ACTIVE_ARCH=YES,ACTIVE ARCH=x86_64,VALID_ARCH=i386
@CorneliusParkin:为此,请单击您的项目导航器,从那里单击目标,然后在架构中,将build ACTIVE archistructure设置为NO。这样做很好。请删除此答案。人们将尝试它,然后查看底部的编辑。)。