使用cocos自带的“生成”会提示该错误
2023-10-7 16:24:18-log: [runCmd ./gradlew] 71 actionable tasks: 11 executed, 60 up-to-date
2023-10-7 16:24:18-log: [runCmd ./gradlew - error] /Applications/Cocos/Creator/3.8.0/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/base/std/hash/hash.h:135:33: error: no template named ‘unary_function’ in namespace ‘std’; did you mean ‘__unary_function’?
struct hash_base : std::unary_function<T, hash_t> {};
~~~~~~~~~~^
__unary_function
/Users/tangbing/Library/Android/sdk/ndk/26.0.10792818/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/__functional/unary_function.h:46:1: note: ‘__unary_function’ declared here
using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
^
2 warnings and 2 errors generated.
ninja: build stopped: subcommand failed.
C++ build system [build] failed while executing:
/Users/tangbing/Library/Android/sdk/cmake/3.22.1/bin/ninja
-C
/Users/tangbing/dyhc/block/build/android/proj/build/RelWithDebInfo/5ix84c5p/arm64-v8a
cocos
from /Users/tangbing/dyhc/block/native/engine/android/app
- Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
- Get more help at https://help.gradle.org
BUILD FAILED in 4s
2023-10-7 16:24:19-warn: failed to exec ./gradlew block:assembleRelease
2023-10-7 16:24:19-log: [task:make]: 构建插件 native 的钩子函数 make 执行失败,请检查插件的代码逻辑~, 23.333333333333332%
2023-10-7 16:24:19-log: [task:make]: failed to exec ./gradlew block:assembleRelease, 36.66666666666667%
2023-10-7 16:24:19-error: make package /Users/tangbing/dyhc/block/build/android failed!
2023-10-7 16:24:19-log: [task:make]: failed!
2023-10-7 16:24:19-debug: // ---- builder:run-build-stage-make ---- (6050ms)
2023-10-7 16:24:19-debug: [Build Memory track]: builder:build-stage-total make start:282.11MB, end 280.82MB, increase: -1315.23KB
又按照文档使用andorid studio打开·proj·目录后,进行build也提示:
error: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
struct hash_base : std::unary_function<T, std::size_t> {};
~~~~~^~~~~~~~~~~~~~
__unary_function
我搜索到了都是关于xcode打包ios的信息,没有找到安卓的问题,请问有什么好的解决办法吗?或者更换cocos 版本?