Flutter assets error: EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE Flutter assets error: EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE dart dart

Flutter assets error: EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE


As far as I know currently only files directly placed under the registered directory are added to assets.

This should work:

flutter:  uses-material-design: true  assets:   - assets/images/   - assets/images/user/


This is how this resolved for me.

Previously I was using the exact paths to images as suggested

 assets: - assets/logo_linked_in.jpg - assets/logo_medium.png - assets/logo_stackoverflow.png - assets/myself.jpg - assets/sparta.jpg - assets/fox.png

Then I tried just the parent directory name, which was just using:

assets: - assets/

Voila! It worked like a charm!

I hope this helps someone.

P.S. - For newbies like me:

Make sure you have correctly indented the pubspec.yamlas this is very important for the build.


In my case I have to correct the alignments between my assets and the uses-material-design lines in pubspec.yaml.

flutter:    uses-material-desgin: true    assets:        - images/3.jpg