Closed luiscarielo83 closed 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
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!
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.
Where: Script '/Users/carielo/FlutterSDK/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1070
What went wrong: Execution failed for task ':app:compileFlutterBuildRelease'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. `