Flutter assets error: EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE

前端 未结 9 1785
借酒劲吻你
借酒劲吻你 2021-01-05 09:17

flutter can not find my images assets, what can I be doing wrong?

I got the error on debugger:

Launching lib/main.dart on XT1097 in debug mode... Built build

相关标签:
9条回答
  • 2021-01-05 09:47

    I faced this error when i was accidentally passing number parameter as URL to get image from server.

    leading: CircleAvatar(
            backgroundImage: NetworkImage(imageUrl),
          ),
    

    //imageUrl should be correct image url not other type.

    0 讨论(0)
  • 2021-01-05 09:47

    Im my case I was in hot reload mode and nothing was happening. I had to click hot restart for the image to show up.

    0 讨论(0)
  • 2021-01-05 09:51

    In my case I have two space between _ and assets that's why this exception coming

    -  assets/images/logo.png
    -  assets/images/bg.jpg
    

    Now I fixed by

    assets:
    - assets/images/logo.png
    - assets/images/bg.jpg
    
    0 讨论(0)
提交回复
热议问题