问题与#34;架构i386的未定义符号"

时间:2014-12-19 15:09:31

标签: ios xcode cordova i386

我们有一个Android / ios应用程序,它在Xcode中正好构建。星期一,我们将Xcode升级到版本6.1.1。从那时起,我无法在Xcode模拟器中构建和运行我们的应用程序。

ld: warning: ignoring file /Users/ACCOUNTZ/Library/Developer/Xcode/DerivedData/Accountz-crbaoextdggovrahxqcivilxfgeh/Build/Products/Debug-iphonesimulator/libCordova.a, file was built for archive which is not the architecture being linked (i386): /Users/ACCOUNTZ/Library/Developer/Xcode/DerivedData/Accountz-crbaoextdggovrahxqcivilxfgeh/Build/Products/Debug-iphonesimulator/libCordova.a
Undefined symbols for architecture i386:
  "_CDVLocalNotification", referenced from:
      -[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
  "_CDVPluginHandleOpenURLNotification", referenced from:
      -[AppDelegate application:openURL:sourceApplication:annotation:] in AppDelegate.o
      -[CDVInAppBrowser openInSystem:] in CDVInAppBrowser.o
      -[AppDelegate application:openURL:sourceApplication:annotation:] in AppDelegate.o
      -[CDVInAppBrowser openInSystem:] in CDVInAppBrowser.o
  "_CDVRemoteNotification", referenced from:
      -[AppDelegate application:didRegisterForRemoteNotificationsWithDeviceToken:] in AppDelegate.o
  "_CDVRemoteNotificationError", referenced from:
      -[AppDelegate application:didFailToRegisterForRemoteNotificationsWithError:] in AppDelegate.o
  "_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
      _OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
  "_OBJC_CLASS_$_CDVCommandQueue", referenced from:
      _OBJC_CLASS_$_MainCommandQueue in MainViewController.o
  "_OBJC_CLASS_$_CDVPlugin", referenced from:
      _OBJC_CLASS_$_GAPlugin in GAPlugin.o
      _OBJC_CLASS_$_CDVClipboard in CDVClipboard.o
      _OBJC_CLASS_$_CDVDevice in CDVDevice.o
      _OBJC_CLASS_$_CDVInAppBrowser in CDVInAppBrowser.o
      _OBJC_CLASS_$_CDVConnection in CDVConnection.o
  "_OBJC_CLASS_$_CDVPluginResult", referenced from:
      objc-class-ref in GAPlugin.o
      objc-class-ref in CDVClipboard.o
      objc-class-ref in CDVDevice.o
      objc-class-ref in CDVInAppBrowser.o
      objc-class-ref in CDVConnection.o
  "_OBJC_CLASS_$_CDVUserAgentUtil", referenced from:
      objc-class-ref in CDVInAppBrowser.o
  "_OBJC_CLASS_$_CDVViewController", referenced from:
      _OBJC_CLASS_$_MainViewController in MainViewController.o
      objc-class-ref in CDVDevice.o
  "_OBJC_CLASS_$_CDVWebViewDelegate", referenced from:
      objc-class-ref in CDVInAppBrowser.o
  "_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
      _OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
  "_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
      _OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
  "_OBJC_METACLASS_$_CDVPlugin", referenced from:
      _OBJC_METACLASS_$_GAPlugin in GAPlugin.o
      _OBJC_METACLASS_$_CDVClipboard in CDVClipboard.o
      _OBJC_METACLASS_$_CDVDevice in CDVDevice.o
      _OBJC_METACLASS_$_CDVInAppBrowser in CDVInAppBrowser.o
      _OBJC_METACLASS_$_CDVConnection in CDVConnection.o
  "_OBJC_METACLASS_$_CDVViewController", referenced from:
      _OBJC_METACLASS_$_MainViewController in MainViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)   

我花了几个小时才弄清楚发生了什么,但似乎超出了我的范围。我确实遵循了网上发现的许多建议,但没有结果。我尝试在Build Phases部分添加“缺失”框架,我使用“仅构建活动架构”,我尝试将此i386架构添加到Target和Project的有效架构列表中。
所有这些都没有效果。

我在这里缺少什么?

1 个答案:

答案 0 :(得分:2)

事实证明,我的应用程序的 Cordova 版本缺少架构(i386)。我的" cordova.a文件被忽略了#34; (根据我的警告),因为事实上我在Xcode升级后丢失了i386架构设置。要解决此问题,我需要通过单击 Cordova.xcodeproj 文件来添加此体系结构。然后我进入 Cordova (而不是Project)构建设置,我必须为 Cordova Build 的Target和Project部分添加我缺少的架构。

我甚至不知道这一部分存在。所以我多次尝试在我的项目本身上调整架构(通过在Navigator中单击项目名称并访问构建设置选项卡),但为了解决我的问题,我只需要通过单击Cordova.xcodeproj文件来实现这一点。

link帮助了我,所以你可能也想关注我。