Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter failed to build on Android due to icon_tree_shaker

After updating Flutter to 1.20.2 (also tried 1.20.1) app failed to build android apk in release mode.

After

flutter build apk

I got error

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

And after

flutter build apk -v

error in build

[   +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)

p.s.

After updating Flutter to 1.20.1 problem with icon tree shaker was also on iOS - but this issue has the solution

like image 820
moonvader Avatar asked Aug 14 '20 10:08

moonvader


1 Answers

Solution was found

If you have same issue, you can run

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

like image 133
moonvader Avatar answered Nov 15 '22 03:11

moonvader