无法构建flutter web App。字体资源“CupertinoIcons.ttf”已被树木摇动,

问题描述 投票:0回答:1

我的应用程序在 iOS、Android 和 Chrome 上运行良好,不幸的是,当我尝试使用

flutter build web
构建网络时,我收到此错误:
Font asset "CupertinoIcons.ttf" was tree-shaken, reducing it from 283452 to 1272 bytes (99.6% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app. Font asset "MaterialIcons-Regular. of" was tree-shaken, reducing it from 1645184 to 10244 bytes (99.4% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app. Compiling lib/main.dart for the Web...   
如何解决它?

flutter web
1个回答
0
投票

如输出中所述,您可以使用

flutter build web --no-tree-shake-icons
禁用树抖动。 tree-shaking 过程显着减少了您的字体资源大小。

© www.soinside.com 2019 - 2024. All rights reserved.