cordova 3.4.1 iOS 命令行构建忽略有效架构?
Posted
技术标签:
【中文标题】cordova 3.4.1 iOS 命令行构建忽略有效架构?【英文标题】:cordova 3.4.1 iOS command line build ignores Valid Architectures? 【发布时间】:2014-05-15 13:04:17 【问题描述】:我正在尝试更新 Sphero PhoneGap plugin 以使用最新的 Cordova 3.4.1 和 XCode 5.1。
如果我在 XCode 中运行它,构建工作正常。在构建设置中,我将“有效架构”指定为 armv7
和 armv7s
。
但是如果我在命令行上执行cordova build --device ios
,那么我会得到:
Running command: /Users/peteshau/dev/src/pearson/prototypes/robots-sphero/phonegap-test/platforms/ios/cordova/build --device
Build settings from command line:
ARCHS = armv7 armv7s arm64
CONFIGURATION_BUILD_DIR = /Users/peteshau/dev/src/pearson/prototypes/robots-sphero/phonegap-test/platforms/ios/build/device
SDKROOT = iphoneos7.1
VALID_ARCHS = armv7 armv7s arm64
...
ld: warning: ignoring file RobotsSphero/Plugins/com.orbotix.sphero.SpheroPlugin/RobotKit.framework/RobotKit, missing required architecture arm64 in file RobotsSphero/Plugins/com.orbotix.sphero.SpheroPlugin/RobotKit.framework/RobotKit (2 slices)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_RKRobotProvider", referenced from:
objc-class-ref in spheroGap.o
"_OBJC_CLASS_$_RKRawMotorValuesCommand", referenced from:
objc-class-ref in spheroGap.o
"_OBJC_CLASS_$_RKPingCommand", referenced from:
objc-class-ref in spheroGap.o
"_OBJC_CLASS_$_RKStabilizationCommand", referenced from:
objc-class-ref in spheroGap.o
"_OBJC_CLASS_$_RKRollCommand", referenced from:
objc-class-ref in spheroGap.o
"_OBJC_CLASS_$_RKCalibrateCommand", referenced from:
objc-class-ref in spheroGap.o
"_OBJC_CLASS_$_RKBackLEDOutputCommand", referenced from:
objc-class-ref in spheroGap.o
"_OBJC_CLASS_$_RKGoToSleepCommand", referenced from:
objc-class-ref in spheroGap.o
"_OBJC_CLASS_$_RKRGBLEDOutputCommand", referenced from:
objc-class-ref in spheroGap.o
"_RKDeviceConnectionOnlineNotification", referenced from:
-[spheroGap setupRobot] in spheroGap.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
(与cordova run --device
相同的错误并且无法启动)。
我正在尝试为运行 iOS 7.1 的 iPhone 5S 构建它。
根据我有限的理解(我对 iOS 开发非常不熟悉),看起来 Cordova 忽略了构建设置中指定的有效架构限制?有没有办法告诉它省略 arm64
以便让它运行?
(如果相关,原生“RobotKit”框架似乎需要Deployment Target being set to 6.0 和各种Linker flags to be set。从命令行输出来看,它似乎使用指定的链接器标志OK)。
【问题讨论】:
我可以通过将 XCode 中的“仅构建活动架构”更改为“是”来运行它。但我仍然认为应该关注“有效架构”而不是? 我已经在 Cordova 问题跟踪器上写了这个:issues.apache.org/jira/browse/CB-6716 【参考方案1】:这是 Cordova 确认的“缺陷”:
https://issues.apache.org/jira/browse/CB-6716
我现在可以通过将“仅构建活动架构”更改为“是”来解决它。
【讨论】:
以上是关于cordova 3.4.1 iOS 命令行构建忽略有效架构?的主要内容,如果未能解决你的问题,请参考以下文章
cordova emulate iOS 从不从命令行工作,但通过 Xcode 很好
Xcodebuild 在 cordova ios 项目中停止