'Could not get cmap table size! in flutter
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)
Solution 1:[1]
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
Solution 2:[2]
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.
Solution 3:[3]
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
Solution 4:[4]
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.
Solution 5:[5]
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
Solution 6:[6]
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 ...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Praveen Kumar Selvaraj |
| Solution 2 | devDeejay |
| Solution 3 | Luis Romero |
| Solution 4 | aligator |
| Solution 5 | Phani Rithvij |
| Solution 6 | Vaibhav Pallod |
