Custom build simulator cocos creator 3.8.0 using gulp always fail

hi i need help about custom build simulator cocos creator 3.8.0.

i have followed instruction on rebuild-the-native-engine-simulator

but when i hit command “gulp gen-simulator” it turns error.
it appear as “C:/Users/user/CocosProject/CocosEngine/native/simulator/generated/cocos/bindings/auto/jsb_physics_auto.cpp”,
and i don’t know why it can’t generate those file jsb_xxxxxxx

please asap

Hi, friend.
are you following the documentation below?
https://docs.cocos.com/creator/manual/en/advanced-topics/engine-customization.html#compilation

and get stuck on the compilation step?

yes @mr.kylin , I already follow all that step but in the end, I got stuck because of that error “can’t found custome-engine/native/simulator/generated/cocos/bindings/auto/jsb_physics_auto.cpp”.
And also I already see the source on the git and there is no such any file with name jsb_xxxxxxx

why do you need a custom build of cocos ?

“why do you need a custom build of cocos?”

I like this question. Because this is the point being open source game engine. Developer has access to develop new features that never made before such as full screen, aspect ratio fitter, 3d audio source and in my case, I wanna improve preview simulator.

Oh yeah that’s great I’m just interested on what changes you really need, I was also looking on making changes, for example I was also writing on How we can support Android TV games. while this works fine if you have a normal gamepad some inputs are missing for the Tv Controllers, I was able to map the missing Input Keys.

Hi @mr.kylin ,
any update yet about my issue? Sorry I just wonder.

Whiles I agree with your right to make a custom build of the engine. The things you listed are all things I would like to see contributed to the core engine :grinning:

Hi @jamessimo , thanks for the kind words, Unfortunately the custom build returns error (you can see the detail above). I’ve follow all instruction on cocos web documentation but still gives same error. I still waiting for cocos team dev’s response.

Hi,sorry for my late reply.
which OS are you using, mac or windows? I will have a test when free.

windows 10

@westdragoneye I think you forgot to download external libs. The binding codes are generated when you build a native project, and it will use the tool that stored in external libs.

So could you please make sure:

  • there is ENGINE_ROOT/native/external/win64/bin/swig file, which includes the program to generate binding codes
  • and i think it should have error message when you run build in cocos creator, could you please make sure there is error log in cocos creator.

Hi Mr @zhangxm , thank you for reply me.

I already download the external library sir. If I don’t there is no way I can run gulp command under its path.

image
this is my swig file. Am I got the right file(s) sir?

and this error I got when I hit command “gulp gen-simulator” on CMD:
[11:03:32] Using gulpfile ~\CocosProject\CocosEngine\native\gulpfile.js
[11:03:32] Starting ‘gen-simulator’…
remove old simulator project

=====================================

make project

=====================================

– Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.

– The CXX compiler identification is MSVC 19.29.30151.0

– Detecting CXX compiler ABI info

– Detecting CXX compiler ABI info - done

– Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped

– Detecting CXX compile features

– Detecting CXX compile features - done

– The C compiler identification is MSVC 19.29.30151.0

– The ASM compiler identification is MSVC

– Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe

– Detecting C compiler ABI info

– Detecting C compiler ABI info - done

– Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped

– Detecting C compile features

– Detecting C compile features - done

– platform: Windows

– Ignore NO_WERROR

– OPTION BUILTIN_COCOS_X_PATH:
– OPTION USE_BUILTIN_EXTERNAL: OFF
– OPTION USE_MODULES: OFF
– OPTION CC_USE_METAL:
– OPTION CC_USE_GLES3: ON
– OPTION CC_USE_GLES2: OFF
– OPTION CC_USE_VULKAN: OFF

– OPTION CC_DEBUG_FORCE: ON
– OPTION USE_SE_V8: ON
– OPTION USE_V8_DEBUGGER: ON
– OPTION USE_V8_DEBUGGER_FORCE: ON
– OPTION USE_SE_SM: OFF
– OPTION USE_SOCKET: ON
– OPTION USE_AUDIO: ON
– OPTION USE_EDIT_BOX: ON
– OPTION USE_VIDEO: OFF
– OPTION USE_WEBVIEW: OFF
– OPTION USE_MIDDLEWARE: ON
– OPTION USE_DRAGONBONES: ON
– OPTION USE_SPINE: ON
– OPTION USE_WEBSOCKET_SERVER: OFF
– OPTION USE_PHYSICS_PHYSX: ON
– OPTION USE_JOB_SYSTEM_TBB: OFF
– OPTION USE_JOB_SYSTEM_TASKFLOW: OFF
– OPTION USE_XR: OFF
– OPTION USE_SERVER_MODE: OFF
– OPTION USE_AR_MODULE: OFF
– OPTION USE_AR_AUTO: OFF
– OPTION USE_AR_CORE: OFF
– OPTION USE_AR_ENGINE: OFF
– OPTION USE_CCACHE:
– OPTION CCACHE_EXECUTABLE: CCACHE_EXECUTABLE-NOTFOUND
– OPTION NODE_EXECUTABLE: C:/Program Files/nodejs/node.exe
– OPTION NET_MODE: 0
– OPTION USE_REMOTE_LOG: OFF

– platform path:

CMake Error at C:/Users/user/CocosProject/CocosEngine/native/cmake/predefine.cmake:227 (message):
Cocos souce file not exists:
“C:/Users/user/CocosProject/CocosEngine/native/simulator/generated/cocos/bindings/auto/jsb_physics_auto.cpp”,
is generated NOTFOUND
Call Stack (most recent call first):
C:/Users/user/CocosProject/CocosEngine/native/CMakeLists.txt:1931 (cocos_source_files)
CMakeLists.txt:40 (include)

– Configuring incomplete, errors occurred!
See also “C:/Users/user/CocosProject/CocosEngine/native/simulator/CMakeFiles/CMakeOutput.log”.
See also “C:/Users/user/CocosProject/CocosEngine/native/simulator/CMakeFiles/CMakeError.log”.

cmake finished!

build project

=====================================

Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1009: Project file does not exist.
Switch: ALL_BUILD.vcxproj

cmake finished!
[11:03:40] Finished ‘gen-simulator’ after 7.79 s

Sorry Mr @zhangxm , I almost forget about log in cocos creator

here the log:

info TOOL Using Visual Studio 16 2019 generator.
info CMD CONFIGURE
info RUN [
info RUN ‘cmake’,
info RUN ‘C:\ProgramData\cocos\editors\Creator\3.8.0\resources\resources\3d\editor-native-scene\win’,
info RUN ‘–no-warn-unused-cli’,
info RUN ‘-G’,
info RUN ‘Visual Studio 16 2019’,
info RUN ‘-A’,
info RUN ‘x64’,
info RUN ‘-DCMAKE_JS_VERSION=6.3.2’,
info RUN ‘-DCMAKE_BUILD_TYPE=Release’,
info RUN ‘-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=C:\ProgramData\cocos\editors\Creator\3.8.0\resources\resources\3d\editor-native-scene\win\build’,
info RUN ‘-DCMAKE_JS_INC=C:\Users\user\.cmake-js\electron-x64\v13.1.4\include\node’,
info RUN ‘-DCMAKE_JS_SRC=C:/ProgramData/cocos/editors/Creator/3.8.0/resources/app.asar.unpacked/builtin/engine/static/engine-compiler/node_modules/cmake-js/lib/cpp/win_delay_load_hook.cc’,
info RUN ‘-DNODE_RUNTIME=electron’,
info RUN ‘-DNODE_RUNTIMEVERSION=13.1.4’,
info RUN ‘-DNODE_ARCH=x64’,
info RUN ‘-DCMAKE_JS_LIB=C:\Users\user\.cmake-js\electron-x64\v13.1.4\x64\node.lib’,
info RUN ‘-DCOCOS_DIR=C:\Users\user\CocosProject\’,
info RUN ‘-DCMAKE_SHARED_LINKER_FLAGS=/DELAYLOAD:NODE.EXE’
info RUN ]
CMake Error: Error: generator : Visual Studio 16 2019
Does not match the generator used previously: Visual Studio 17 2022
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
ERR! OMG Process terminated: 1
info TOOL Using Visual Studio 16 2019 generator.
info CMD CONFIGURE
info RUN [
info RUN ‘cmake’,
info RUN ‘C:\ProgramData\cocos\editors\Creator\3.8.0\resources\resources\3d\editor-native-scene\win’,
info RUN ‘–no-warn-unused-cli’,
info RUN ‘-G’,
info RUN ‘Visual Studio 16 2019’,
info RUN ‘-A’,
info RUN ‘x64’,
info RUN ‘-DCMAKE_JS_VERSION=6.3.2’,
info RUN ‘-DCMAKE_BUILD_TYPE=Release’,
info RUN ‘-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=C:\ProgramData\cocos\editors\Creator\3.8.0\resources\resources\3d\editor-native-scene\win\build’,
info RUN ‘-DCMAKE_JS_INC=C:\Users\user\.cmake-js\electron-x64\v13.1.4\include\node’,
info RUN ‘-DCMAKE_JS_SRC=C:/ProgramData/cocos/editors/Creator/3.8.0/resources/app.asar.unpacked/builtin/engine/static/engine-compiler/node_modules/cmake-js/lib/cpp/win_delay_load_hook.cc’,
info RUN ‘-DNODE_RUNTIME=electron’,
info RUN ‘-DNODE_RUNTIMEVERSION=13.1.4’,
info RUN ‘-DNODE_ARCH=x64’,
info RUN ‘-DCMAKE_JS_LIB=C:\Users\user\.cmake-js\electron-x64\v13.1.4\x64\node.lib’,
info RUN ‘-DCOCOS_DIR=C:\Users\user\CocosProject\’,
info RUN ‘-DCMAKE_SHARED_LINKER_FLAGS=/DELAYLOAD:NODE.EXE’
info RUN ]
CMake Error at CMakeLists.txt:49 (include):
include could not find requested file:
C:\Users\user\CocosProject/engine/native/CMakeLists.txt
ERR! OMG Process terminated: 1

Yep, it seems the swig program is correct. We will take a look.

1 Like

Thanks sir

@westdragoneye Can you check if the directory is an empty folder or just jsb_physics_auto.cpp does not exist?

Have you tried deleting or backing up the ‘C:/Users/user/CocosProject/CocosEngine/native/simulator’ directory and trying again?

image

The directory is exist but jsb_physics_auto.cpp and other are not.

I have tried delete all things under simulator directory and rebuild again. But all efforts I made just give same issue. Even if I tried reinstall via github source (including external lib), it returns same error.

I am afraid there is missing step that doesn’t describe on cocos creator documentation to generate or download those file cpp (jsb_physics_auto.cpp and other).

Is there a log like the following:

None of them