【发布时间】: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