unhandledRejectedPromise 和 rejectAfterPromiseResolved 报错

web调试的时候正常,打包Android后运行报错如下:
E/Cocos: 16:56:05 [ERROR]: [ERROR] file C:/Work/jsxn/native/engine/common/Classes/Game.cpp: line 54
16:56:05 [ERROR]:
Uncaught Exception:
- location :
- msg : unhandledRejectedPromise
- detail :
Error: Unable to instantiate chunks:///_virtual/PageStory.ts from chunks:///_virtual/GameMgr.ts
PromiseConstructor Promisestacktrace:
D/jswrapper: JS: [ERROR]: unhandledRejectedPromise Error: Unable to instantiate chunks:///_virtual/PageStory.ts from chunks:///_virtual/GameMgr.ts
PromiseConstructor Promisestacktrace:
E/Cocos: 16:56:05 [ERROR]: [ERROR] file C:/Work/jsxn/native/engine/common/Classes/Game.cpp: line 54
16:56:05 [ERROR]:
Uncaught Exception:
- location :
- msg : unhandledRejectedPromise
- detail :
Error: Unable to instantiate chunks:///_virtual/PageMiniGameUi.ts from chunks:///_virtual/GameMgr.ts
PromiseConstructor Promisestacktrace:
D/jswrapper: JS: [ERROR]: unhandledRejectedPromise Error: Unable to instantiate chunks:///_virtual/PageMiniGameUi.ts from chunks:///_virtual/GameMgr.ts
PromiseConstructor Promisestacktrace:
E/Cocos: 16:56:05 [ERROR]: [ERROR] file C:/Work/jsxn/native/engine/common/Classes/Game.cpp: line 54
16:56:05 [ERROR]:
Uncaught Exception:
- location :
- msg : unhandledRejectedPromise
- detail :
Error: Unable to instantiate chunks:///_virtual/PopupProp.ts from chunks:///_virtual/ArchiveMgr.ts
PromiseConstructor Promisestacktrace:
D/jswrapper: JS: [ERROR]: unhandledRejectedPromise Error: Unable to instantiate chunks:///_virtual/PopupProp.ts from chunks:///_virtual/ArchiveMgr.ts
PromiseConstructor Promisestacktrace:
E/Cocos: 16:56:05 [ERROR]: [ERROR] file C:/Work/jsxn/native/engine/common/Classes/Game.cpp: line 54
16:56:05 [ERROR]:
Uncaught Exception:
- location :
- msg : rejectAfterPromiseResolved
- detail :
Error: Unable to instantiate chunks:///_virtual/PageMiniGameUi.ts from chunks:///_virtual/GameMgr.ts
PromiseConstructor Promisestacktrace:
D/jswrapper: JS: [ERROR]: rejectAfterPromiseResolved Error: Unable to instantiate chunks:///_virtual/PageMiniGameUi.ts from chunks:///_virtual/GameMgr.ts
PromiseConstructor Promisestacktrace:
E/Cocos: 16:56:05 [ERROR]: [ERROR] file C:/Work/jsxn/native/engine/common/Classes/Game.cpp: line 54
16:56:05 [ERROR]:
Uncaught Exception:
- location :
- msg : rejectAfterPromiseResolved
- detail :
Error: Unable to instantiate chunks:///_virtual/PopupProp.ts from chunks:///_virtual/ArchiveMgr.ts
PromiseConstructor Promisestacktrace:
D/jswrapper: JS: [ERROR]: rejectAfterPromiseResolved Error: Unable to instantiate chunks:///_virtual/PopupProp.ts from chunks:///_virtual/ArchiveMgr.ts
PromiseConstructor Promisestacktrace:
JS: [ERROR]: Error: Unable to instantiate chunks:///_virtual/PageStory.ts from chunks:///_virtual/GameMgr.ts

请问该如何解决

这个问题很久了,android上正常catch的Promise也会报这两条错误

但我写了个demo,又不会报这个错。
主要是现在不知道怎么定位问题,没有思路。。

这个问题是必现的,创建Promise中直接同步调用resolve或者reject,在android下必然会报上面的两条错误,web是正常不会报错的

我验证这种用法在Android下是不会报错的,不知道你说的是哪种用法?

@ccclass('Test')
export class Test extends Component {
    @property(Sprite)
    sprite: Sprite = null;
    
    onClickBtn() {
        this.getImg()
            .then((img)=>{
                console.log("resolve");
            }).catch(()=>{
                console.log("reject");
            });
    }
    
    getImg() {
        return new Promise<SpriteFrame>((resolve, reject)=>{
            // 这里如果没有异步调用, 同步直接调用reject或resolve
            reject();
        });
    }
}

Android下必报unhandledRejectedPromise

这是实验的引擎版本号是多少呢?

收到,我们会验证并解决。

任何版本,包括最新的测试版3.4.1

问题已经报给引擎组同事处理了,感谢反馈