Closed Pianzhous closed 8 months ago
目前不支持canvaskit渲染模式
好的,谢谢大佬
近期考虑支持canvaskit吗?flutter_web_optimizer 1.1.12 ;Flutter 3.3.10可以运行canvaskit
@liyingte998 ,周末看下
@liyingte998 ,周末看下
大佬有时间解决下canvaskit兼容问题不,flutter3.16及以后版本
@TryImpossible why does the code give issues when it comes to canvaskit rendering, any root cause problem?
@TryImpossible why does the code give issues when it comes to canvaskit rendering, any root cause problem?
@TryImpossible 把项目中的flutter3.10的flutter.js换成flutter3.16的打包版本中的flutter.js修改下,canvaskit是可以用的,需要帮忙尽快支持到项目中
@TryImpossiblewhy does the code give issues when it comes to canvaskit rendering, any root cause problem?
@TryImpossibleReplace the flutter.js of flutter3.10 in the project with the flutter.js in the packaged version of flutter3.16. After modification, canvaskit can be used. I need help to support it in the project as soon as possible.
could you please share the flutter.js
file that you may have modified and replaced?
@TryImpossiblewhy does the code give issues when it comes to canvaskit rendering, any root cause problem?
@TryImpossibleReplace the flutter.js of flutter3.10 in the project with the flutter.js in the packaged version of flutter3.16. After modification, canvaskit can be used. I need help to support it in the project as soon as possible.
could you please share the
flutter.js
file that you may have modified and replaced?
1、flutter build web打包后,将flutter.js单独保存到临时目录 2、执行flutter_web_optimizer生成相关文件 3、将第1步打包生成的flutter.js替换第2步flutter_web_optimizer自动生成的flutter.js,然后修改flutter.js文件里的main.dart.js引用的生成的hash文件名,就可以了 4、canvaskit打包运行可能flutter_web_optimizer引用的flutter.js不是新版本的,所以可能导致打包后运行报错,建议项目作者抽空兼容下flutter3.16
@Pianzhous @navyzhou926 @liyingte998 ,1.4.0版本适配flutter 3.16版本 ,支持canvaskit模式
@TryImpossiblewhy does the code give issues when it comes to canvaskit rendering, any root cause problem?
@TryImpossibleReplace the flutter.js of flutter3.10 in the project with the flutter.js in the packaged version of flutter3.16. After modification, canvaskit can be used. I need help to support it in the project as soon as possible.
could you please share the
flutter.js
file that you may have modified and replaced?
@t0uh33d ,https://github.com/TryImpossible/flutter_web_optimizer/blob/main/lib/src/optimize/flutter.js.dart
@TryImpossible why does the code give issues when it comes to canvaskit rendering, any root cause problem?
@t0uh33d ,you could need flutter_web_optimizer 1.4.0 version
@Pianzhous @navyzhou926 @liyingte998 ,1.4.0版本适配flutter 3.16版本 ,支持canvaskit模式
执行flutter_web_optimizer报错
环境信息: Flutter (Channel stable, 3.16.9, on macOS 14.2.1 23C71 darwin-arm64, locale zh-Hans-CN) • Flutter version 3.16.9 on channel stable at /Users/navyzhou/Projects/Library/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 41456452f2 (4 weeks ago), 2024-01-25 10:06:23 -0800 • Engine revision f40e976bed • Dart version 3.2.6 • DevTools version 2.28.5
执行flutter_web_optimizer报错信息(使用html和canvaskit打包都报错): navyzhou@MacBook:~/git/flutter_test$ dart run flutter_web_optimizer optimize --asset-base ./ --enable-pwa false Building package executable... Built flutter_web_optimizer:flutter_web_optimizer. start web optimize hashing file: /Users/navyzhou/git/flutter_test/build/web/icons/Icon-192.png hashed file name: Icon-192.ac9a721a.png hashing file: /Users/navyzhou/git/flutter_test/build/web/icons/Icon-maskable-192.png hashed file name: Icon-maskable-192.c457ef57.png hashing file: /Users/navyzhou/git/flutter_test/build/web/icons/Icon-maskable-512.png hashed file name: Icon-maskable-512.301a7604.png hashing file: /Users/navyzhou/git/flutter_test/build/web/icons/Icon-512.png Unhandled exception: Invalid argument (Not a byte value at index 1: 0x-5c): _Int8ArrayView
canvaskit 提供个demo
canvaskit 提供个demo
找到原因了,base64.encode需要用Uint8List,而不能用Int8List,因为encode的数据只能是0~255,而不能是有符号的,optimize_comand.dart改成如图即可,已验证没有问题了,请帮忙尽快修改
canvaskit 提供个demo
找到原因了,base64.encode需要用Uint8List,而不能用Int8List,因为encode的数据只能是0~255,而不能是有符号的,optimize_comand.dart改成如图即可,已验证没有问题了,请帮忙尽快修改
已修复,请使用1.4.1版本
大佬,是不支持canvaskit渲染模式吗?报了这个错