码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • flutter Unable to load asset: assets/images/888.png


    报错

    Debug service listening on ws://127.0.0.1:65376/KSCFS_eCpng=/ws
    Syncing files to device iPhone 13…

    ======== Exception caught by image resource service ================================================
    The following assertion was thrown resolving an image codec:
    Unable to load asset: assets/images/888.png

    When the exception was thrown, this was the stack:
    #0 PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:237:7)

    #1 AssetBundleImageProvider._loadAsync (package:flutter/src/painting/image_provider.dart:658:14)

    Image provider: AssetImage(bundle: null, name: “assets/images/888.png”)
    Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#05eaa(), name: “assets/images/888.png”, scale: 1.0)

    请添加图片描述

    错误的写法

    请添加图片描述

    flutter:
    
      # The following line ensures that the Material Icons font is
      # included with your application, so that you can use the icons in
      # the material Icons class.
      uses-material-design: true
      # To add assets to your application, add an assets section, like this:
    assets:
         - assets/images/
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    正确的写法

    # The following section is specific to Flutter packages.
    flutter:
    
      # The following line ensures that the Material Icons font is
      # included with your application, so that you can use the icons in
      # the material Icons class.
      uses-material-design: true
      # To add assets to your application, add an assets section, like this:
      assets:
         - assets/images/
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    请添加图片描述

    即 assets 和 uses-material-design: true 是对齐的

  • 相关阅读:
    Docker的四种网络模式
    UI自动化测试框架:PO 模式+数据驱动(超详细)
    视频转gif怎样操作?1分钟在线视频转gif制作
    java计算机毕业设计老鹳窝旅游网源码+系统+数据库+lw文档+mybatis+运行部署
    来看看安卓机的几个应用程序
    C/C++ 快速入门
    生成式AI时代,亚马逊云科技致力推动技术的普惠,让更多企业受益
    Python编写Word文档
    向日葵管理平台添加主机,获取葵码,在设备上进行绑定
    PMP每日十题-2024年2月29日
  • 原文地址:https://blog.csdn.net/LIUXIAOXIAOBO/article/details/125509911
  • 最新文章
  • 沪漂五周年了:我越来越迷茫了
    Agentic Skill Routing 实战:别再把所有 Skill 塞进 AI Agent 上下文
    MySQL-Seconds_behind_master的精度误差
    [MAF预定义ChatClient中间件-03]CachingChatClient——利用缓存省钱省时间
    AI的至暗历史:从万众期待到被政府撤资,AI的两次死亡徘徊
    Agent OS :五种驯服不确定性的范式
    PortSwigger SQL注入LAB11
    数据库即时编译JIT
    [Begin]AI Learn Data Day 0
    深度学习进阶(二十七)现代 LLM 的核心架构设计其二:SwiGLU
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号