Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97355

unable to load asset [flutter]

$
0
0

I tried yesterday to put an image and it was working just fine but when I tried to run it again it gave me this error:

Restarted application in ٢٬٧٦٥ms.

[38;5;248m════════ Exception caught by image resource service ════════════════════════════[39;49m
[38;5;244mThe following assertion was thrown resolving an image codec:[39;49m
Unable to load asset: cat.jpg

[38;5;244mWhen the exception was thrown, this was the stack[39;49m
[38;5;244m#0      PlatformAssetBundle.load[39;49m
[38;5;244m<asynchronous suspension>[39;49m
[38;5;244m#1      AssetBundleImageProvider._loadAsync[39;49m
[38;5;244m<asynchronous suspension>[39;49m
[38;5;244m#2      AssetBundleImageProvider.load[39;49m
[38;5;244m...[39;49m
[38;5;244mImage provider: AssetImage(bundle: null, name: "cat.jpg")[39;49m
[38;5;244mImage key: AssetBundleImageKey(bundle: PlatformAssetBundle#7533e(), name: "cat.jpg", scale: 1.0)[39;49m
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m

and here is the yaml:

flutter:
  uses-material-design: true
  assets:
    - images/cat.jpg

and in main

child: Image(
  image: AssetImage('cat.jpg'),
),

so what's the problem here?


Viewing all articles
Browse latest Browse all 97355

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>