Could not get cmap table size! in flutter

Viewed 6235
E/flutter ( 7514): [ERROR:flutter/third_party/txt/src/minikin/FontFamily.cpp(184)] Could not get cmap table size!
E/flutter ( 7514): 
F/flutter ( 7514): [FATAL:flutter/third_party/txt/src/minikin/FontCollection.cpp(95)] nTypefaces == 0
F/libc    ( 7514): Fatal signal 6 (SIGABRT), code -6 in tid 7541 (1.ui)
6 Answers

Remove the white space in the file names of assets and reload the application

Still the debug console shows the error but it 's just the error cache file ignore it and wait for some time for the emulator to load the application.

It will work perfectly.. Have a happy coding

My font files got corrupted, I tried opening them inside Android Studio and they weren't opening.

Readding fresh font assets fixed the issue for me.

change the path file from

  fonts:
  - family: Karla
    fonts:
    - asset: lib\Fonts\Karla\Karla-Regular.ttf

to this type

  fonts:
  - family: Karla
    fonts:
    - asset: lib/Fonts/Karla/Karla-Regular.ttf

For me it turned out to be the experimental obfuscation mode that caused it. removing extra-gen-snapshot-options=--obfuscate from gradle.properties solved it.

Other people were getting it because of bad internet connection, corrupt or unsupported fonts or a typo when declaring the fonts in pubspec.yaml.

For me, the issue was the font files having LF Unix end of line sequence because I created the project in Linux. I encountered this issue when I was running this on windows. I had to download unix2dos binaries and make all of the files CRLF.

rm -rf build/ # Delete build files to because they get generated.

unix2dos **/**

# run flutter
flutter run -v

If you feel you'd entered everything correctly still giving exception of Could not get cmap table size! in flutter after adding fonts file correctly in folder and mentioning it in yaml.

Then Just do invalidate cache and restart worked for me ...

Related