[Cocos Creator 2.4.x] build custom cocos2d-x engine on Mac?

Hi

I have implemented script native bridge module by following docs url.
This works on android platfrom on window OS but does not work on iOS platform on the mac OS.
I suspect cocos dashboard is not reconizing the custom cocos2d-x engine source.

How would I resolve this problem?

Thank you in advance.

https://docs.cocos.com/creator/2.4/manual/en/advanced-topics/engine-customization.html
https://docs.cocos.com/creator/manual/en/advanced-topics/js-oc-bridge.html
https://docs.cocos.com/creator/manual/en/advanced-topics/jsb-bridge-wrapper.html

======== Cocos Dashboard error message ========
Loading custom engine failed! The editor has switched back to the builtin engine. Please go to Perference panel to set the correct engine path.

Error call stack: ReferenceError: ScriptNativeBridge is not defined
at Object.get [as bridge] (/Users/xxx/Documents/workspace/CocosEnv/Engine/creator/bin/.cache/dev/cocos2d/core/platform/CCNative.js:164:34)
at __define (/Users/xxx/Documents/workspace/CocosEnv/Engine/creator/bin/.cache/dev/cocos2d/core/platform/CCNative.js:257:21)
at /Users/xxx/Documents/workspace/CocosEnv/Engine/creator/bin/.cache/dev/cocos2d/core/platform/CCNative.js:266:25
at Object. (/Users/xxx/Documents/workspace/CocosEnv/Engine/creator/bin/.cache/dev/cocos2d/core/platform/CCNative.js:273:19)
at Module._compile (internal/modules/cjs/loader.js:1078:30)
at Object.p (/Applications/Cocos/Creator/2.4.13/CocosCreator.app/Contents/Resources/app.asar/editor-framework/lib/share/require.js:1:1814)
at Module.load (internal/modules/cjs/loader.js:935:32)
at Module._load (internal/modules/cjs/loader.js:776:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Module.require [as __require] (internal/modules/cjs/loader.js:959:19)

here is my windows platform environment
and I made it same on this mac os

Windows 11, MacOS Ventura 13.6.3

NDK_ROOT=C:\CocosEnv\Android\ndk\r22b
JAVA_HOME=C:\CocosEnv\jdk-17
ANT_ROOT=C:\CocosEnv\apache-ant-1.9.7
ANDROID_SDK_ROOT=C:\CocosEnv\Android\sdk
cocos creator : 2.4.13
cocos dashboard : 2.1.2
nodejs : v11.15.0
python : v2.7.10
cmake : v3.29.0
ant : v1.9.7
openssl : v0.9.8k
visual studio : Visual Studio 2017 Community
gradle : v7.4.2 or high
ndk : r22b
sdk : android-13
jdk : v17

I have resolved this problem.
the cocos dashboard is desktop application.
i had modified the custom javascript engine source to resolve this issue.
it works perfectly.

1 Like