Xcode26.5运行cocos构建的项目报错,官方修复过吗?

cocos 3.8.8
构建用Xcode打开后无法运行
报错1
Applications/Cocos/Creator/3.8.8/CocosCreator.app/Contents/Resources/resources/3d/engine/native/external/sources/enoki/half.h:23:19 ‘is_floating_point’ cannot be specialized: Users are not allowed to specialize this standard library entity

/Applications/Cocos/Creator/3.8.8/CocosCreator.app/Contents/Resources/resources/3d/engine/native/external/sources/enoki/half.h:24:19 ‘is_arithmetic’ cannot be specialized: Users are not allowed to specialize this standard library entity

/Applications/Cocos/Creator/3.8.8/CocosCreator.app/Contents/Resources/resources/3d/engine/native/external/sources/enoki/half.h:25:19 ‘is_signed’ cannot be specialized: Users are not allowed to specialize this standard library entity
如果用AI修复
#if 0

NAMESPACE_BEGIN(std)

template <> struct is_floating_pointenoki::half : std::true_type {};

template <> struct is_arithmeticenoki::half : std::true_type {};

template <> struct is_signedenoki::half : std::true_type {};

NAMESPACE_END(std)

#endif
修改成这样后
安装到iOS设备里面就会黑屏报


这样的错,改了很多次没有解决成功

  1. 下载一个opencode
  2. 打开一个opencode, 模型切换到免费模型,deepSeek v4 flash free, 或者其他标注的free模型
  3. 在对话框里输入: 我的Xcode项目路径是 xxxx/xxxx/xxxxx/cocos.xcodproj,现在编译失败了,你帮我看一下,然后修复一下
  4. 等待五分钟

如果这也不愿意做,可以付费给我,我给你整

我将版本降低到26.3了这些问题已经不报了,我用gpt5.4他都改不完,每改一个就会出现新的问题,不过谢谢大佬告知

boost_container的minmum deployment没有设置值,xcode26.5会默认赋值26.5,低于iOS26.5的设备运行就会异常,修改cmake,给boost_container的DEPLOYMENT_TARGET设置为主工程统一的值就可以了

好麻烦,还不如百度一下,立刻出答案了

在 Xcode 中点击左侧的 boost_container Target -> Build Settings -> Deployment
把 26.5 修改为 同项目 Deployment值

改成12.0 不好使呀

修改成Xcode版本不行,在提交审核的时候被拒审了,理由就是att权限在iPad的iOS是26.5没弹出来,我再看看有没有其他方法,修改boost_container Target -> Build Settings -> Deployment
把 26.5 修改为 同项目 Deployment值,如图依旧不行

将报错的代码

// 将这部分:
NAMESPACE_BEGIN(std)
template<> struct is_floating_point<enoki::half> : true_type { };
template<> struct is_arithmetic<enoki::half> : true_type { };
template<> struct is_signed<enoki::half> : true_type { };
NAMESPACE_END(std)

修改成如下

// 改为:
#ifdef __GLIBCXX__
// GCC/Clang with libstdc++
NAMESPACE_BEGIN(std)
template<> struct is_floating_point<enoki::half> : true_type { };
template<> struct is_arithmetic<enoki::half> : true_type { };
template<> struct is_signed<enoki::half> : true_type { };
NAMESPACE_END(std)
#endif

亲测,确实可以成功编译项目

这是英文版块的解决方案,具体没试过,仅供参考

1赞

他那个跟我上面写的一样,多写了一个libwebp.a文件

再次感谢各位大佬的帮助:pray: