flutterfontsassetspubspecpubspec.yaml

unable to locate asset entry for a font in flutter


I'm trying to run my flutter application that used to run perfectly but it suddenly showed "unable to locate asset entry" for a font error,

screenshot of the error

and I've checked the indentations in the pubspec.yaml and they were correct, but I noticed the pubspec.lock file has been modified I don't know if that's relevant to the error I couldn't figure out where the problem is screenshot of .yaml screenshot of pubspec.lock


Solution

  • I think it's a small issue as you forgot to add fonts in the path you typed so you need to have it like that:

    assets/fonts/Tajawal/Tajawal-ExtraBold.ttf
    

    if it is not the case please provide the structure of your assets folder.