Ahmadre / FlutterIconPicker

An adaptive comprehensive IconPicker for Flutter
MIT License
112 stars 76 forks source link

This application cannot tree shake icons fonts... #40

Closed luiscarielo83 closed 2 years ago

luiscarielo83 commented 2 years ago

Flutter 2.8.1 • channel stable • https://github.com/flutter/flutter.git Framework • revision 77d935af4d (6 weeks ago) • 2021-12-16 08:37:33 -0800 Engine • revision 890a5fca2e Tools • Dart 2.15.1

When generating the apk I get this error:

` This application cannot tree shake icons fonts. It has non-constant instances of IconData at the following locations:

FAILURE: Build failed with an exception.

Katekko commented 2 years ago

You will need to build your apk using this argument: --no-tree-shake-icons

This is because, for default flutter exclude all the icons that you are not using, but when you try to use a IconData that's not const by default, you need to pass the --no-tree-shake-icons to build your application

flutter build appbundle --release --no-tree-shake-icons

luiscarielo83 commented 2 years ago

You will need to build your apk using this argument: --no-tree-shake-icons

This is because, for default flutter exclude all the icons that you are not using, but when you try to use a IconData that's not const by default, you need to pass the --no-tree-shake-icons to build your application

flutter build appbundle --release --not-tree-shake-icons

Thanks!