【问题标题】:Cordova linker error when Build Active Architecture Only is No "file was built for archive which is not the architecture being linked (i386)"仅构建活动架构时 Cordova 链接器错误“没有为归档构建文件,该文件不是被链接的架构 (i386)”
【发布时间】:2015-04-23 03:19:44
【问题描述】:

我在 Mac Yosemite 中使用最新的 Cordova 版本,使用命令行工具做了以下操作

cordova 创建 xxxx com.xxxx xxxx

cd xxxx

cordova平台添加ios

现在我打开平台下的xcode项目文件,打开xcode 6

然后我转到构建设置 -> 仅构建活动架构 -> 否

现在我运行示例准系统 cordova 应用程序,它引发了一堆链接器错误

ld: warning: ignoring file /Users/joelasirvathamjesudoss/Library/Developer/Xcode/DerivedData/xxxx-ehdvqzsskcnwbncktgdnuqbbnloq/Build/Products/Debug-iphonesimulator/libCordova.a, file was built for archive which is not the architecture being linked (i386): /Users/joelasirvathamjesudoss/Library/Developer/Xcode/DerivedData/xxxx-ehdvqzsskcnwbncktgdnuqbbnloq/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
  "_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_$_CDVViewController", referenced from:
      _OBJC_CLASS_$_MainViewController in MainViewController.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_$_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)

但是当我更改构建设置 -> 仅构建活动架构 -> 是 一切正常。

现在我知道在提交到 App Store 时 Build Active Architecture Only 应该是否。

所以请指教我哪里出错了

设置如下所示 提前致谢

【问题讨论】:

    标签: ios xcode cordova build linker-errors


    【解决方案1】:

    您能确认一下您的设置是这样的吗?

    【讨论】:

    • 你能检查一下所有的 .m 文件都被添加了吗?检查构建设置中的编译源。这可能会帮助你stackoverflow.com/questions/4839981/…
    • 我浏览了那个链接。我没有向应用程序添加任何代码,它是一个简单的示例 PhoneGap 构建。我没有添加任何东西。这些是我做的唯一步骤 1)cordova create xxxx com.xxxx xxxx 2)cd xxxx 3)cordova platform add ios ...然后更改构建设置
    • 请检查 Cordova 库中的设置
    • 非常感谢,这为我节省了很多调试时间!
    • 你为什么要删除?
    猜你喜欢
    • 2011-12-13
    • 1970-01-01
    • 2015-01-19
    • 2019-01-24
    • 1970-01-01
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多