[BUG]项目添加了apple watch 支持,编译失败

在xcode中编译能成功,再creator 中编译提示失败,原因如图所示:

图片不清楚可以看文字
ld: warning: object file (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/lib/clang/7.3.0/lib/darwin/libclang_rt.ios.a(emutls.c.o)) was built for newer iOS version (6.0) than being linked (5.1.1)
Undefined symbols for architecture i386:
OBJC_CLASS$_WCSession”, referenced from:
objc-class-ref in RootViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Showing first 200 warnings only

** BUILD FAILED **

The following build commands failed:
Ld /Users/mac/Downloads/Work/jsb-default/publish/ios/Project-mobile.app/Project-mobile normal i386
(1 failure)
Build failed: Take a look at the output above for details.

关于_OBJC_CLASS_$_WCSession", referenced from: 这个我已经在app 中添加了,

, 并且在xcode中能通过,求大神点拨。

Undefined symbols for architecture i386:
“OBJCCLASS_$_WCSession”, referenced from:
objc-class-ref in RootViewController.o
ld: symbol(s) not found for architecture i386

从这段可以看出在链接 i386 平台的时候无法找到 WCSession,WatchConnectivity 应该是只在 iOS 端有效,而 i386 是 iOS 模拟器,我不确定模拟器是否支持 WatchConnectivity 如果不支持,可能需要通过宏或者其它 API 来做预判断。

没有编译过 Watch,猜测原因是这样

楼主如果解决了问题的话可以分享一下具体原因和解决方案

在cocos creator 编译会报错,但是在xcode中编译不会报错,目前的我在creator中只构建不编译, 在xcode中编译运行.