gradle 由于icon_tree_shaker,Flutter无法在Android上构建

yqlxgs2m  于 2023-08-06  发布在  Flutter
关注(0)|答案(2)|浏览(118)

更新Flutter到1.20.2后(也尝试了1.20.1)应用程序无法在发布模式下构建android apk。
之后

flutter build apk

字符串
我出错了

Script '/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 896


之后呢

flutter build apk -v


构建错误

[   +1 ms] [        ] Failed to subset font; aborting.
[   +2 ms] [   +8 ms] Target aot_android_asset_bundle failed: FontSubset error: Font subsetting failed with exit code 255.
[        ]            #0      IconTreeShaker.subsetFont (package:flutter_tools/src/build_system/targets/icon_tree_shaker.dart:213:7)


附言
更新Flutter到1.20.1后,图标树振动器的问题也出现在iOS上-但this issue有解决方案

x6yk4ghg

x6yk4ghg1#

已找到解决方案
如果你有同样的问题,你可以运行
flutter build apk --no-tree-shake-icons

ekqde3dh

ekqde3dh2#

试试这个

flutter build apk -v --no-tree-shake-icons

字符串

相关问题