Open bymoye opened 1 month ago
I am aware that there are issues with the WASM version.
Do you have a stack trace for the crash? We also had issues with the positioning of the camera preview on web, when running on WASM.
stack trace
Sorry, I don't have a stack trace. But I found out that if you don't pull up the camera, the page will not crash. However, once the camera is called up (guessing the rendering interface), the page will crash and print in the console And the camera will be turned on (Android phone camera prompt). Through the Performance Monitor in Chrome's DevTools, you can see that the CPU usage is always at 100%.
I deployed the example to https://test.nazo.run, and perhaps the problem can be reproduced on all devices.
It seems there is an open report for a similar bug in SkWasm at https://github.com/flutter/flutter/issues/150119
Does this reproduce if you switch to the master channel?
It seems there is an open report for a similar bug in SkWasm at flutter/flutter#150119
Does this reproduce if you switch to the master channel?
I tried switching to the master channel. The page still freezes. But there is no output in my console.
Sorry, I take back my previous answer.
Because I tried to use flutter clean
, then flutter pub get
and then flutter build web --wasm
, which miraculously solved the crash. It seems that the problem lies with flutter?
version:
Flutter 3.24.0-1.0.pre.214 • channel master • https://github.com/flutter/flutter.git
Framework • revision c63733310f (2 days ago) • 2024-07-20 19:26:30 -0400
Engine • revision 207f088f73
Tools • Dart 3.6.0 (build 3.6.0-55.0.dev) • DevTools 2.37.1
The remaining problem is the problem of misalignment.
I tried to use the example in the project and compiled it with
flutter build web --wasm
, and then according to the flutter wasm documentation, useddhttpd '--headers=Cross-Origin-Embedder-Policy=credentialless;Cross-Origin-Opener-Policy=same-origin'
to run the web. Then, any operation that calls up the camera will cause the page to freeze (crash). My flutter version:chrome version: 126.0.6478.183
mobile_scanner version: ^5.1.1 Maybe it’s related to skwasm.