'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



Solution 1:[1]

Solution was found

If you have same issue, you can run

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

Solution 2:[2]

Try this.

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 moonvader
Solution 2 germain kataku