timmaffett / material_symbols_icons

Complete Flutter support for google's Material DesignMaterial Symbols Icons
Apache License 2.0
31 stars 4 forks source link

expected to find fonts for... message when building in release or profile #23

Closed wildsylvan closed 1 week ago

wildsylvan commented 1 week ago

when i run flutter build apk in release or profile i get this message in the console:

Expected to find fonts for (packages/cupertino_icons/CupertinoIcons, MaterialIcons, packages/material_symbols_icons/MaterialSymbolsRounded, packages/material_symbols_icons/MaterialSymbolsOutlined, packages/material_symbols_icons/MaterialSymbolsSharp), but found (MaterialIcons, packages/material_symbols_icons/MaterialSymbolsOutlined, packages/material_symbols_icons/MaterialSymbolsRounded, packages/material_symbols_icons/MaterialSymbolsSharp). This usually means you are referring to font families in an IconData class but not including them in the assets section of your pubspec.yaml, are missing the package that would include them, or are missing "uses-material-design: true".

then:

Font asset "MaterialSymbolsRounded.ttf" was tree-shaken, reducing it from 11604280 to 23304 bytes (99.8% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Font asset "MaterialSymbolsSharp.ttf" was tree-shaken, reducing it from 6878156 to 2404 bytes (100.0% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 1424 bytes (99.9% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.

i tried both adding and removing uses-material-design: true but the message doesn't change

im using the icons with import 'package:material_symbols_icons/symbols.dart'; and Icon(Symbols.<NAME>)


can i just ignore the build message?

timmaffett commented 1 week ago

I have not seen this message before. I looks like it is not finding the packages/cupertino_icons/CupertinoIcons icons - which are for iOS. I don't know what might be causing the cupertino icons to not get included.

I would say that if your material symbols icons are appearing (the ones you refer to as Symbols.XYZ) then i would just ignore the build message. It does look like the material symbols icons fonts are correctly being tree-shaken so I suspect you are seeing all the icons correctly.

wildsylvan commented 1 week ago

yeah... the material symbols icons are defenitely working. there must be some dependency in my project that's referencing cupertino_icons (and i refuse to add it as a dependency since im not using it). thanks, i think this can be closed