Comments (5)
Hi @k-ane. This appears to be related to this open Flutter bug, in which CanvasKit is unable to render glyphs outside of the BMP (Basic Multilingual Plane) of Unicode. It does not appear to be solved, and the solution everyone seems to take is the same you have said above, using the html renderer.
from flutter.
For some added context, the issue only occurs with canvaskit. When using --web-renderer html the duotone icons load fine. May be a Flutter issue not an issue of this package
from flutter.
Compiling lib/main.dart for the Web...
This application cannot tree shake icons fonts. It has non-constant instances of IconData at the following locations:
- file:///opt/hostedtoolcache/flutter/3.10.0-stable/x64/.pub-cache/hosted/pub.dev/phosphor_flutter-2.0.0/lib/src/phosphor_icons_regular.dart:8:23
- file:///opt/hostedtoolcache/flutter/3.10.0-stable/x64/.pub-cache/hosted/pub.dev/phosphor_flutter-2.0.0/lib/src/phosphor_icons_regular.dart:11:29
...
- file:///opt/hostedtoolcache/flutter/3.10.0-stable/x64/.pub-cache/hosted/pub.dev/phosphor_flutter-2.0.0/lib/src/phosphor_icons_duotone.dart:7486:5
Target web_release_bundle failed: Exception: Avoid non-constant invocations of IconData or try to build again with --no-tree-shake-icons.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 IconTreeShaker._findConstants (package:flutter_tools/src/build_system/targets/icon_tree_shaker.dart:307:7)
<asynchronous suspension>
#2 IconTreeShaker._getIconData (package:flutter_tools/src/build_system/targets/icon_tree_shaker.dart:108:45)
<asynchronous suspension>
#3 IconTreeShaker.subsetFont (package:flutter_tools/src/build_system/targets/icon_tree_shaker.dart:172:5)
<asynchronous suspension>
#4 copyAssets.<anonymous closure> (package:flutter_tools/src/build_system/targets/assets.dart:127:25)
<asynchronous suspension>
#5 Future.wait.<anonymous closure> (dart:async/future.dart:525:21)
<asynchronous suspension>
#6 copyAssets (package:flutter_tools/src/build_system/targets/assets.dart:105:3)
<asynchronous suspension>
#7 WebReleaseBundle.build (package:flutter_tools/src/build_system/targets/web.dart:385:29)
<asynchronous suspension>
#8 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:847:9)
<asynchronous suspension>
#9 Future.wait.<anonymous closure> (dart:async/future.dart:525:21)
<asynchronous suspension>
#10 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:785:32)
<asynchronous suspension>
#11 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:614:16)
<asynchronous suspension>
#12 WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:81:34)
<asynchronous suspension>
#13 BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:191:5)
<asynchronous suspension>
#14 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1336:27)
<asynchronous suspension>
#15 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#16 CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#17 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:296:9)
<asynchronous suspension>
#18 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#19 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:244:5)
<asynchronous suspension>
#20 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:91:9)
<asynchronous suspension>
#21 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#22 main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>
Compiling lib/main.dart for the Web... 90.2s
Exception: Failed to compile application for the Web.
Error: Process completed with exit code 1.
from flutter.
How to use html renderer and build apk?
from flutter.
This should be fixed with #26
from flutter.
Related Issues (20)
- TikTokLogoFill Icon has extra padding on the right HOT 3
- Icons misalign on Chrome for Android HOT 1
- Any update for 2.0 icons? HOT 2
- sealCheckFill Icon is missing HOT 1
- Please support icons in v2.0.0. HOT 2
- Non-Constant Invocations of IconData in v 2.0.0 HOT 4
- Make weight classes implements an interface
- An error occurs when building flutter for Android HOT 4
- Implement an initial rotation HOT 2
- Static icon classes and its members should be const HOT 4
- Duotone icons looks like regular in master branch HOT 3
- Downloading all fonts on the web, even when using only one type of icon HOT 1
- Error to build apk with: phosphor_flutter: ^2.0.0 HOT 4
- Error to build app phosphor_flutter-2.0.0 HOT 3
- Why api changed in a minor version? HOT 2
- Missing some fill icons HOT 1
- Update package HOT 7
- Implement dual tone HOT 5
- Export icons by type HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.