cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
8.33k stars 1.95k forks source link

[3.8.2] The AR project crashes after executing game.restart #16815

Open zhefengzhang opened 7 months ago

zhefengzhang commented 7 months ago

Cocos Creator version

3.8.2

System information

Android

Issue description

image

Relevant error log output

企业微信截图_17110164726547

Steps to reproduce

-

Minimal reproduction project

https://download.cocos.org/CocosTechnicalSupport/EngineIssues/16815/TestXRPlugin.zip

QingliWang commented 7 months ago
  1. This project just enabled the AR capability without any AR node(e.g. AR Session, AR Camera, etc.), many code branches with USE_AR_XXX might give wrong result.
  2. It's better to get the requirement, and implement the suitable restart("destroy/init") workflow for AR session.The restart frequency should not be too high, because the AR session init/connection event need some time, also to recreate the AR data(plane, anchor, etc.) need more time.
  3. It takes time to develop the AR session restart workflow. For workaround, refer to Cocos dashboard AR sample project, when switch scene between different AR features, the app will restart the AR session, similar to the issue case.