Android 16KB 页面大小特性支持 & 引擎库更新

什么时候出2.4.x的,火烧眉头了 :sweat_smile:

同顶 老项目2.4.x 已经在催包了

什么时候出2.4.x的… v8崩溃。。。。。。。。

尝试3.8,7 16kb 的分支无法启动,启动报错 TypeError: Only absolute URLs are supported

at getNodeRequestOption

说下我的出现流程,引擎组大佬可以看看对不对
1、下载3.8.7-16k仓库的zip,地址 :https://github.com/cocos/cocos-engine/tree/v3.8.7-16k
2、根据下载后引擎包后,根据Native中的external-config.json的版本号 v3.8.7-18 配置下载 至 Native中并改名 external,下载地址:https://github.com/cocos/cocos-engine-external/tree/v3.8.7-18
3、根目录npm install(文后附install日志,看着没啥问题,ts的一些类型提示中之前自定义引擎的时候也有)
4、创建一个3.x空项目
5、引擎设置里自定义引擎根目录
6、重启报错
7、电脑版本: Apple M1 Pro


以下是npm install 日志

npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm warn deprecated w3c-hr-time@1.0.2: Use your platform’s native performance.now() and performance.timeOrigin.
npm warn deprecated fsevents@1.2.13: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
npm warn deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm warn deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm warn deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.

cocos-creator@3.8.7 postinstall
npm run build:debug-infos && npm run build:declaration && npm run build:adapter && npm run build:native-pack-tool

cocos-creator@3.8.7 build:debug-infos
node ./scripts/build-debug-infos

==================== Build debug infos ====================
==================== DONE! ====================

cocos-creator@3.8.7 build:declaration
npm run build:const && node ./scripts/build-declarations

cocos-creator@3.8.7 build:const
node ./scripts/build-const.js

==================== Build const ====================

Generate consts.d.ts: /Applications/Cocos/Creator/cocos-engine-3.8.7-16k/@types/consts.d.ts

==================== Build declarations ====================
Typescript version: 4.9.5
With index: true
With exports: false
With editor exports: true
Unbundled will write to: /Applications/Cocos/Creator/cocos-engine-3.8.7-16k/__dts_before_bundle
Generating…
It’s 2025/9/7 23:47:37, we’re still doing the hack for spine-core.d.ts
Bundling…
DeprecationWarning: ‘’ has been deprecated since v4.0.0. Use the appropriate method on ‘ts.factory’ or the ‘factory’ supplied by your transformation context instead.
Failed to resolve type import("…/foundation/node-shell").NodeInputPath, There is no symbol info.
DeprecationWarning: ‘createIndexSignature’ has been deprecated since v4.8.0. Decorators are no longer supported for this function. Callers should switch to an overload that does not accept a ‘decorators’ parameter.
Don’t know how to handle type #${string}(Syntax Kind: TemplateLiteralType)
Failed to resolve type import(‘pal/audio/type’).AudioLoadOptions, There is no symbol info.
Failed to resolve type import(‘pal/audio/type’).AudioLoadOptions, There is no symbol info.
Failed to resolve type import(‘pal/audio/type’).AudioLoadOptions, There is no symbol info.
Failed to resolve type import(‘pal/audio/type’).AudioType, There is no symbol info.
Failed to resolve type import(‘pal/audio/type’).AudioState, There is no symbol info.
Failed to resolve type import(‘pal/audio/type’).AudioPCMDataView, There is no symbol info.
Don’t know how to handle type ${x}(Syntax Kind: TemplateLiteralType)
Don’t know how to handle type ${x}(Syntax Kind: TemplateLiteralType)
Failed to resolve type import(‘pal/input/input-source’).InputSourceButton, There is no symbol info.
Failed to resolve type import(‘pal/input/input-source’).InputSourceDpad, There is no symbol info.
Failed to resolve type import(‘pal/input/input-source’).InputSourceStick, There is no symbol info.
Failed to resolve type import(‘pal/input/input-source’).InputSourcePosition, There is no symbol info.
Failed to resolve type import(‘pal/input/input-source’).InputSourceOrientation, There is no symbol info.
Don’t know how to handle element enable of interface
Don’t know how to handle element enable of interface

cocos-creator@3.8.7 build:adapter
node ./scripts/build-adapter.js

==================== Build adapter ====================

Bundling native adapter
Generate bundle: engine-adapter.js
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
(node:79544) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use node --trace-deprecation ... to show where the warning was created)
Generate bundle: web-adapter.js

Bundling minigame platform adapters, including: alipay,bytedance,taobao,taobao-mini-game,wechat,xiaomi
handle platform: alipay
Generate bundle: engine-adapter.js
Generate bundle: web-adapter.js
handle platform: bytedance
Generate bundle: engine-adapter.js
Generate bundle: web-adapter.js
handle platform: taobao
Generate bundle: engine-adapter.js
Generate bundle: web-adapter.js
handle platform: taobao-mini-game
Generate bundle: engine-adapter.js
Generate bundle: web-adapter.js
handle platform: wechat
Generate bundle: engine-adapter.js
Generate bundle: web-adapter.js
handle platform: xiaomi
Generate bundle: engine-adapter.js
Generate bundle: web-adapter.js

Bundling runtime platform adapters, including: honor-mini-game,huawei-quick-game,migu-mini-game,oppo-mini-game,vivo-mini-game
handle platform: honor-mini-game
Generate bundle: engine-adapter.js
handle platform: huawei-quick-game
Generate bundle: engine-adapter.js
handle platform: migu-mini-game
Generate bundle: engine-adapter.js
handle platform: oppo-mini-game
Generate bundle: engine-adapter.js
handle platform: vivo-mini-game
Generate bundle: engine-adapter.js
Bundle Adapter: 5.552s

cocos-creator@3.8.7 build:native-pack-tool
cd ./scripts/native-pack-tool && npm install && npm run build

npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated

native-pack-tool@0.0.1 preinstall
cd ./xcode && npm install --production

npm warn config production Use --omit=dev instead.

added 9 packages, and audited 10 packages in 2s

1 package is looking for funding
run npm fund for details

found 0 vulnerabilities

added 169 packages, and audited 170 packages in 5s

3 packages are looking for funding
run npm fund for details

5 vulnerabilities (1 low, 2 moderate, 2 high)

To address issues that do not require attention, run:
npm audit fix

To address all issues (including breaking changes), run:
npm audit fix --force

Run npm audit for details.

native-pack-tool@0.0.1 build
tsc --build

added 1528 packages, and audited 1529 packages in 45s

137 packages are looking for funding
run npm fund for details

36 vulnerabilities (4 low, 13 moderate, 12 high, 7 critical)

To address issues that do not require attention, run:
npm audit fix

To address all issues possible (including breaking changes), run:
npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run npm audit for details.

按这位老哥说的搞定了,项目正常打开了,后续再验证安卓

2.4.x 这周可以吗?

2.x的,直接参考 engine仓库修改就可以了,ndk升级到28。 后面会更新对应的pr

参考:https://blog.csdn.net/gpf1320253667/article/details/151322842 其余的根据自己项目的报错去修改,比如我还修改了源码中的一个报错: 将 ALooper_pollAll 替换为 ALooper_pollOnce

还有大佬发csdn这种强制给免费文章收钱的平台,

1赞

2.x的呢??????打包成exe,直接让大家在dashboard里下载不行吗?非要弄github,太麻烦了。

有关注 2.x 支持 Android 16kb 页面特性的,可以参考这个 PR , ndk使用28+

发版本有一个过程,没那么快,有周期。

在置顶里编辑一下2.x的相关信息吧,至少提一嘴。

哇,竟然秒回。感谢。目前没改动引擎打包出来的能过16kb检测,但是线上有v8导致的崩溃,就很恼人。

刚看了下,这个方法怎么比我的还麻烦。既然也只是为了过16kb检测,那还不如直接改动打包出来的android工程了。关键是v8,这么在cocos引擎里好像是编译好的静态库。这个v8怎么处理呢?直接使用置顶里提到的3.x的v8吗???通用的吗?

2.x的不用修改v8, v8 8.0 没有这个字段kMinimumOSPageSize,只要保证用ndk 28编译的应用就可以确认支持16kb页面特性。

ok。明白了。 [split_config.arm64_v8a.apk!libcocos2djs.so] v8::HandleScope::Initialize(v8::Isolate*) - Creator 2.x - Cocos中文社区 那这个问题有研究过吗?这个问题只要按照目前的打包16kb流程,打包出来之后线上必现,2.x版本。

16kb, 需要确保所有使用的so,都用统一的配置编译,比如都用ndk 28+编译;这样才能保证整个app是支持16kb 特性。至于v8 崩溃堆栈,建议提供复现环境,光看log没看出具体问题点。