ios – “架构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部分添加“missing”框架,我使用“Build Active Architectures Only”,我尝试将这个i386架构添加到Target和Project的有效架构列表中.
所有这些都没有效果.

我在这里错过了什么?

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

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

link帮助了我,所以你可能也想跟随.

点赞