fluttercommunity / font_awesome_flutter

The Font Awesome Icon pack available as Flutter Icons
Other
831 stars 233 forks source link

Pro icons not rendering #219

Closed ZsoltFischer closed 1 year ago

ZsoltFischer commented 2 years ago

Description

Font Awesome 6.1.1 Pro icons are rendered with a crossed-out placeholder whereas free icons are displayed correctly.

In the widget inspector I can see the all icons (e.g.: FontAwesomeIcons.brainArrowCurvedRight-> IconData(U+0F677)) but the display is still not right.

To Reproduce

FontAwesomeFlutter version: 10.1.0 FontAwesome version: 6.1.1

I do have the pro icons. I've placed all .ttf files and the icons.json under font_awesome_flutter/lib/fonts, and ran the configurator.

The output of configurator.sh: #

Using font_awesome_flutter version 10.1.0 Downloading https://api.github.com/repos/fluttercommunity/font_awesome_flutter/releases

Custom icons.json found, generating files Duotone icons are no longer supported. Automatically disabled them.

Generating icon definitions Formatted lib/font_awesome_flutter.dart Formatted 1 file (1 changed) in 0.59 seconds.

Generating example code Formatted example/lib/icons.dart Formatted 1 file (1 changed) in 0.37 seconds.

Found and enabled the following icon styles: brands, regular, solid, light, thin

Running "dart pub get" Resolving dependencies... Because font_awesome_flutter depends on flutter_test from sdk which doesn't exist (the Flutter SDK is not available), version solving failed.

Flutter users should run flutter pub get instead of dart pub get.

Done

I've tried the following steps:

  1. Stopping the app
  2. Running flutter clean in app directory
  3. Deleting the app from simulator / emulator / device
  4. Rebuild & Deploy the app.

Expected behavior I'd like the pro icons to display like the free ones.

Screenshots

The icon on top is a pro icon, the bottom one is free. faicon

Desktop:

Smartphone:

michaelspiss commented 2 years ago

Hi, thanks for this very detailed problem description.

Please go to your font_awesome_flutter directory, run flutter clean and then flutter pub get - this will likely fix your problem.

You may have to run flutter clean in your project where font_awesome_flutter is a dependency as well - then rebuild it.

ZsoltFischer commented 2 years ago

Hi, This is exactly what I started with (both project and font_awesome_flutter directories + deleting app from emulator) without any results unfortunately. I also tried deleting .lock and other generated files too.

michaelspiss commented 2 years ago

Ok, another guess would be that the icon file names do not match those in the pubspec.yaml (of font_awesome_flutter).

The generator said it enabled all styles successfully, so it's probably either this or some sort of caching..

ZsoltFischer commented 2 years ago

Checked the file names, they are correct. I ran clean(s) & cache repair multiple times unfortunately without success. The only unusual warning is this, when I run pub get in font_awesome_flutter: # This app is using a deprecated version of the Android embedding. To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding. Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects # However after some searching it seems like this shouldn't cause the problem

I also tried deleting the whole font_awesome_flutter directory and cloned the current source code.

michaelspiss commented 2 years ago

Are the icons also missing in the example app?

(To run via command line: Change directory to font_awesome_flutter/example Run flutter run)

This way we'd be able to narrow down the problem.

ZsoltFischer commented 2 years ago

On Android it fails with:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Warning ───────────────────────────────────────────────────────── Your Flutter application is created using an older version of the Android embedding. It is being deprecated in favor of Android embedding v2. Follow the steps at

https://flutter.dev/go/android-project-migration

to migrate your project. You may also pass the --ignore-deprecation flag to ignore this check and continue with the deprecated v1 embedding. However, the v1 Android embedding will be removed in future versions of Flutter. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ The detected reason was:

/Users/.../font_awesome_flutter/example/android/app/src/main/AndroidManifest.xml uses android:name="io.flutter.app.FlutterApplication" ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Build failed due to use of deprecated Android v1 embedding.

ZsoltFischer commented 2 years ago

[update]: On iOS Simulator the example app starts, but with render errors. It seems like the problem only affects the Regular and Solid icons.

simulator_screenshot_D9B03211-E3F9-4737-AFCA-8808D8C87EF1

hauketoenjes commented 2 years ago

I have the same Problem and can confirm that cleaning dependencies and doesn't work for me either.

It's the same problem that @ZsoltFischer has. The regular and solid icons do not work, the others do.

michaelspiss commented 2 years ago

Thanks for your feedback @ZsoltFischer and @hauketoenjes. I'll take a look as soon as possible. I cannot give you an estimate as to when I will be able to, as I am currently very short on time.

hauketoenjes commented 2 years ago

Ok, this is interesting. It seems that the problem was on Font Awesome's side. I just re-downloaded the icon fonts and now they are working as expected (see the screenshots)

When looking at the git diff, they changed something in the .ttf files and also the icons.json file got changed with a new lastModified date for all icons (from 7 days ago, instead of a few months ago). Maybe this got fixed in the 6.1.2 Release of Font Awesome.

So, the fix for this issue would be to just re-download the Font-Awesome Fonts and re-run the configurator script.

@michaelspiss I think this issue can then be closed. Maybe @ZsoltFischer can try it out to confirm that this was indeed the issue and got solved by Font Awesome.

Before re-downloading:

fontawesome broken

After re-downloading:

fontawesome working
michaelspiss commented 1 year ago

Thanks @hauketoenjes for this more than welcome update! I'd love to hear if this works for @ZsoltFischer as well, just to make sure.

ZsoltFischer commented 1 year ago

Hi! Thank you for the suggestion, this solved the problems for me too. I think this issue can be closed now.