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

Out of project font causes the app to crash with an unclear error message #26108

Closed
modulovalue opened this issue Jan 5, 2019 · 8 comments
Closed
Labels
a: assets Packaging, accessing, or using assets c: crash Stack traces logged to the console tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@modulovalue
Copy link

Steps to Reproduce

  1. add this font to the pubspec.yaml Comic-Sans-Regular.ttf like this
fonts:
    - family: Comicsans
      fonts:
        - asset: ../../../flutter-desktop-embedding/example/flutter_app/fonts/Comic-Sans-Regular.ttf
  1. try to run the app inside an iOS Simulator and it crashes with the following error:
VERBOSE-2:FontFamily.cpp(184)] Could not get cmap table size!
[VERBOSE-2:FontFamily.cpp(184)] Could not get cmap table size!
[VERBOSE-3:FontCollection.cpp(95)] nTypefaces == 0

I expected that the file would either load or at least an error message would print like that the asset was not found.

Using this font vice versa in google/flutter-desktop-embedding did not crash the app but a fallback font was used there with the following error message printed to the XCode console:

[ERROR:flutter/third_party/txt/src/minikin/FontFamily.cpp(184)] Could not get cmap table size!

[ERROR:flutter/third_party/txt/src/minikin/FontFamily.cpp(184)] Could not get cmap table size!

[ERROR:flutter/third_party/txt/src/minikin/FontFamily.cpp(184)] Could not get cmap table size!

[ERROR:flutter/third_party/txt/src/minikin/FontFamily.cpp(184)] Could not get cmap table size!

[ERROR:flutter/third_party/txt/src/minikin/FontFamily.cpp(184)] Could not get cmap table size!

Flutter doctor:

[✓] Flutter (Channel master, v1.1.5-pre.37, on Mac OS X 10.14.1 18B75, locale de-DE)
    • Flutter version 1.1.5-pre.37 at /Users/valauskasmodestas/Desktop/flutter
    • Framework revision faae8bde78 (7 days ago), 2018-12-28 23:03:40 -0500
    • Engine revision 995e3247fe
    • Dart version 2.1.1 (build 2.1.1-dev.0.1 88e6fe0f67)

[!] Android toolchain - develop for Android devices (Android SDK version 27.0.3)
    • Android SDK at /Users/valauskasmodestas/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 27.0.3
    • Java binary at: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/java
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_152-ea-b05)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[!] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    ✗ Verify that all connected devices have been paired with this computer in Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    • ios-deploy 1.9.2
    ✗ ios-deploy out of date (1.9.4 is required). To upgrade with Brew:
        brew upgrade ios-deploy
    • CocoaPods version 1.5.3
@kangwang1988
Copy link
Contributor

@GaryQian
Any ideas towards this issue?

@GaryQian
Copy link
Contributor

GaryQian commented Jan 5, 2019

I've seen that error before, but it usually ended up being an unrelated or non-flutter issue such as a corrupted font. I think that error occurs whenever a font is somehow improperly loaded and used. I can try to repro and look at it deeper.

@kangwang1988
Copy link
Contributor

@modulovalue
A minimal demo project which can reproduce this issue would be much helpful.

@modulovalue
Copy link
Author

font_error_demo

@zoechi
Copy link
Contributor

zoechi commented Jan 5, 2019

Looks like #19791, #8403

@zoechi zoechi added c: crash Stack traces logged to the console tool Affects the "flutter" command-line tool. See also t: labels. a: assets Packaging, accessing, or using assets labels Jan 5, 2019
@zoechi zoechi added this to the Goals milestone Jan 5, 2019
@jonahwilliams
Copy link
Member

Duplicate of #8403

@david-daming
Copy link

david-daming commented Sep 19, 2020

I delete the fonts folder and create it again, then download the ttf file again, the issue fixed! I guess it may be caused by the file error.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: assets Packaging, accessing, or using assets c: crash Stack traces logged to the console tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

6 participants