Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError was thrown building FaIcon-[<'secondaryGlyph'> #171

Closed
ghenry opened this issue Jun 10, 2021 · 18 comments
Closed

RangeError was thrown building FaIcon-[<'secondaryGlyph'> #171

ghenry opened this issue Jun 10, 2021 · 18 comments

Comments

@ghenry
Copy link

ghenry commented Jun 10, 2021

Hi all,

I seem to be getting this on upgrading to Flutter 2.2.1 and I've not changed anything I can see. I've added this to the file in question:

// @dart=2.11

as I'm not fully null safety migrated yet and this may well be nothing to do with FA, but it's all I've got to go on. Any ideas?

======== Exception caught by widgets library =======================================================
The following RangeError was thrown building FaIcon-[<'secondaryGlyph'>](IconData(U+11F5EA), color: Color(0x662092ed), dirty, dependencies: [Directionality, IconTheme]):
Invalid value: Not in inclusive range 0..1114111: 1177066

The relevant error-causing widget was: 
  FaDuotoneIcon file:///home/ghenry/AndroidStudioProjects/surevoip_talk/lib/src/view/home.dart:307:43
When the exception was thrown, this was the stack: 
#0      new String.fromCharCode (dart:core-patch/string_patch.dart:45:5)
#1      FaIcon.build (package:font_awesome_flutter/src/fa_icon.dart:106:22)
#2      StatelessElement.build (package:flutter/src/widgets/framework.dart:4648:28)
#3      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4574:15)
#4      Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)

Thanks.

@michaelspiss
Copy link
Collaborator

You may need to run the update script again. 9.1.0 mainly contained changes for duotone icons

@ghenry
Copy link
Author

ghenry commented Jun 10, 2021 via email

@ghenry
Copy link
Author

ghenry commented Jun 11, 2021

Just confirmed, ./tools/update.sh was run.

@michaelspiss
Copy link
Collaborator

I tested v6 beta before releasing 9.1.0 and did not find any errors. Can you run the example app in font_awesome_flutter to test wether this is an issue in your app or with this package?

@michaelspiss
Copy link
Collaborator

To explain the error:
secondaryGlyph is the key of the secondary colored part of a duotone icon (which is a FaIcon as well). As we are not using any arrays, my guess was that there was an update to an icon which changed its address in the ttf files.

@ghenry
Copy link
Author

ghenry commented Jun 11, 2021 via email

@ghenry
Copy link
Author

ghenry commented Jun 11, 2021

Hmmm, flutter run gives me:

lib/main.dart:112:43: Error: Getter not found: 'search'.                
            icon: FaIcon(FontAwesomeIcons.search),                      
                                          ^^^^^^                        
                                                                        
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* Where:                                                                
Script '/home/ghenry/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1035

in the core FA repo of yours updated for fontawesome-pro-6.0.0-beta1-web

@ghenry
Copy link
Author

ghenry commented Jun 11, 2021

Yeah, they've renamed most icons now which I had to sort in my code:

https://fontawesome.com/v5.15/icons/search?style=solid

is now:

https://fontawesome.com/v6.0/icons/magnifying-glass?style=solid

Thanks.

@ghenry
Copy link
Author

ghenry commented Jun 11, 2021

Switching to this and I can run the app:

icon: FaIcon(FontAwesomeIcons.magnifyingGlass),                      

but I hit the same error in the example app as I'm getting in my app on quite a few icons as I scroll down.

I can share my pro repo with you if you like? I just followed the instructions like normal for pro. The fact that the thin style is there should show that I did it correct?

Screenshot_1623414099
Screenshot_1623414090
Screenshot_1623414085
Screenshot_1623414075

Thanks.

@ghenry
Copy link
Author

ghenry commented Jun 11, 2021

Full error on Android 11 simulator:

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following RangeError was thrown building FaIcon-[<'secondaryGlyph'>](IconData(U+11F9EE), color:
Color(0xdd000000), dirty, dependencies: [IconTheme, Directionality]):
Invalid value: Not in inclusive range 0..1114111: 1178094

The relevant error-causing widget was:
  FaIcon-[<'secondaryGlyph'>]
  file:///home/ghenry/src/font_awesome_flutter_pro/lib/src/fa_duotone_icon.dart:61:11

When the exception was thrown, this was the stack:
#0      new String.fromCharCode (dart:core-patch/string_patch.dart:45:5)
#1      FaIcon.build (package:font_awesome_flutter/src/fa_icon.dart:106:22)
#2      StatelessElement.build (package:flutter/src/widgets/framework.dart:4648:28)
#3      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4574:15)
#4      Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#5      ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4553:5)
#6      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4548:5)
#7      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611:14)
#8      MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6221:36)
#9      MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6232:32)
...     Normal element mounting (42 frames)
#51     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611:14)
#52     MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6221:36)
#53     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6232:32)
...     Normal element mounting (115 frames)
#168    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611:14)
#169    Element.updateChild (package:flutter/src/widgets/framework.dart:3363:18)
#170    SliverMultiBoxAdaptorElement.updateChild (package:flutter/src/widgets/sliver.dart:1241:37)
#171    SliverMultiBoxAdaptorElement.createChild.<anonymous closure> (package:flutter/src/widgets/sliver.dart:1226:20)
#172    BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2535:19)
#173    SliverMultiBoxAdaptorElement.createChild (package:flutter/src/widgets/sliver.dart:1219:12)
#174    RenderSliverMultiBoxAdaptor._createOrObtainChild.<anonymous closure> (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:349:23)
#175    RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:1889:59)
#176    PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:912:15)
#177    RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1889:14)
#178    RenderSliverMultiBoxAdaptor._createOrObtainChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:338:5)
#179    RenderSliverMultiBoxAdaptor.insertAndLayoutChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:484:5)
#180    RenderSliverGrid.performLayout (package:flutter/src/rendering/sliver_grid.dart:658:17)
#181    RenderObject.layout (package:flutter/src/rendering/object.dart:1779:7)
#182    RenderSliverEdgeInsetsPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:137:12)
#183    RenderSliverPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:371:11)
#184    RenderObject.layout (package:flutter/src/rendering/object.dart:1779:7)
#185    RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:510:13)
#186    RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1574:12)
#187    RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1483:20)
#188    RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1636:7)
#189    PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:881:18)
#190    RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:462:19)
#191    WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:876:13)
#192    RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:328:5)
#193    SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15)
#194    SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1082:9)
#195    SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998:5)
#199    _invoke (dart:ui/hooks.dart:163:10)
#200    PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259:5)
#201    _drawFrame (dart:ui/hooks.dart:126:31)
(elided 3 frames from dart:async)

════════════════════════════════════════════════════════════════════════════════════════════════════

Another exception was thrown: A RenderFlex overflowed by 99839 pixels on the bottom.
D/skia    ( 5739):    1	Shader compilation error
D/skia    ( 5739):    2	------------------------
D/skia    ( 5739):    3	Errors:
D/skia    ( 5739):    4	

Another exception was thrown: RangeError: Invalid value: Not in inclusive range 0..1114111: 1176765

Another exception was thrown: A RenderFlex overflowed by 99839 pixels on the bottom.
D/skia    ( 5739):    1	Shader compilation error
D/skia    ( 5739):    2	------------------------
D/skia    ( 5739):    3	Errors:
D/skia    ( 5739):    4	

Another exception was thrown: RangeError: Invalid value: Not in inclusive range 0..1114111: 1176701

Another exception was thrown: A RenderFlex overflowed by 99839 pixels on the bottom.

Another exception was thrown: RangeError: Invalid value: Not in inclusive range 0..1114111: 1176702

Another exception was thrown: A RenderFlex overflowed by 99839 pixels on the bottom.

Another exception was thrown: RangeError: Invalid value: Not in inclusive range 0..1114111: 1176398

Another exception was thrown: A RenderFlex overflowed by 99839 pixels on the bottom.

@ghenry
Copy link
Author

ghenry commented Jun 11, 2021

And my changes in core repo for pro:

localhost ~/src/font_awesome_flutter_pro/example [master*]$ gits
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   android/.gradle/buildOutputCleanup/buildOutputCleanup.lock
	modified:   android/.gradle/buildOutputCleanup/outputFiles.bin
	modified:   lib/icons.dart
	modified:   lib/main.dart
	modified:   ../lib/font_awesome_flutter.dart
	modified:   ../lib/fonts/fa-brands-400.ttf
	modified:   ../lib/fonts/fa-regular-400.ttf
	modified:   ../lib/fonts/fa-solid-900.ttf
	modified:   ../pubspec.yaml

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	../icons.json
	../lib/fonts/fa-duotone-900.ttf
	../lib/fonts/fa-light-300.ttf
	../lib/fonts/fa-thin-100.ttf

no changes added to commit (use "git add" and/or "git commit -a")

@kyiii
Copy link

kyiii commented Jun 19, 2021

Am also experiencing this as of the latest FA pro version.

@ghenry
Copy link
Author

ghenry commented Jun 19, 2021 via email

@michaelspiss
Copy link
Collaborator

They've changed the duotone font file's layout for v6, that's why it isn't working anymore. Working on it right now.

@ghenry
Copy link
Author

ghenry commented Jun 24, 2021 via email

@michaelspiss
Copy link
Collaborator

michaelspiss commented Jun 24, 2021

@stedekay just drew my attention to a new attribute in icons.json - namely "aliases". Will see what I can do with this. If you have input regarding this, please leave a comment in #159

@michaelspiss
Copy link
Collaborator

michaelspiss commented Jun 24, 2021

It looks like we have to wait a bit longer for them to finish v6. Currently the documentation (https://fontawesome.com/v6.0) mentions addresses which do not exist within the font files.

@michaelspiss
Copy link
Collaborator

Support for duotone icons has been discontinued with version 10 of font_awesome_flutter. For the reasons why, please have a look at this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants