FlutterIconPicker icon indicating copy to clipboard operation
FlutterIconPicker copied to clipboard

This application cannot tree shake icons fonts.

Open nagringapp opened this issue 3 years ago • 5 comments

I'm tyring to build to production and am getting the following error:

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

  • file:///Users/mac/Development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_iconpicker-3.2.2/lib/Serialization/iconDataSerialization.dart:76:16

FAILURE: Build failed with an exception.

  • Where: Script '/Users/mac/Development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1159

  • What went wrong: Execution failed for task ':app:compileFlutterBuildProdRelease'.

Process 'command '/Users/mac/Development/flutter/bin/flutter'' finished with non-zero exit value 1

  • 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.

  • Get more help at https://help.gradle.org

nagringapp avatar Dec 28 '22 12:12 nagringapp

Any update on this one?

nagringapp avatar Jan 17 '23 23:01 nagringapp

This is referenced in the documentation. Add the build argument --no-tree-shake-icons & you should be good!

flutterWithChris avatar Jan 26 '23 16:01 flutterWithChris

I have added it, however, it doesn't sound like the right way to do it - it seems a workaround rather than the right approach. (I didn't need to add this argument before using this package)

On Fri, 27 Jan 2023 at 02:08, Christian Vergara @.***> wrote:

This is referenced in the documentation. Add the build argument --no-tree-shake-icons & you should be good!

— Reply to this email directly, view it on GitHub https://github.com/Ahmadre/FlutterIconPicker/issues/52#issuecomment-1405240555, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU6ICBHSKPLB2PIDZ2FTLBTWUKOPXANCNFSM6AAAAAATLHSYLA . You are receiving this because you authored the thread.Message ID: @.***>

-- Kind Regards,

Thiago Bernardes Founder 0448 087 563 www.nagringa.app https://www.hungy.app/?utm_source=signature&utm_medium=email&utm_campaign=contact-tb

nagringapp avatar Jan 30 '23 06:01 nagringapp

I have added it, however, it doesn't sound like the right way to do it - it seems a workaround rather than the right approach. (I didn't need to add this argument before using this package) … On Fri, 27 Jan 2023 at 02:08, Christian Vergara @.> wrote: This is referenced in the documentation. Add the build argument --no-tree-shake-icons & you should be good! — Reply to this email directly, view it on GitHub <#52 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU6ICBHSKPLB2PIDZ2FTLBTWUKOPXANCNFSM6AAAAAATLHSYLA . You are receiving this because you authored the thread.Message ID: @.> -- Kind Regards, Thiago Bernardes Founder 0448 087 563 www.nagringa.app https://www.hungy.app/?utm_source=signature&utm_medium=email&utm_campaign=contact-tb

What you could try is to implement this package by yourself. Then you would see that you would also have to use --no-tree-shake-icons.

This is not linked to this package honestly, but rather the fact, that you want to provide your user a set of Icons which could be used or not (So: a "Picker").

That's why you need this flag when building.

Ahmadre avatar Jun 04 '23 18:06 Ahmadre

For more see: https://github.com/flutter/flutter/issues/16311

Ahmadre avatar Jun 04 '23 18:06 Ahmadre