• 赚钱入口【需求资源】限时招募流量主、渠道主,站长合作;【合作模式】CPS长期分成,一次推广永久有收益。主动打款,不扣量;

Image not loading in Flutter

Flutter cps12345 4个月前 (08-07) 43次浏览 0个评论

问题: 图片加载异常

I/flutter ( 3214): ══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════ I/flutter ( 3214): The following assertion was thrown resolving an image codec: I/flutter ( 3214): Unable to load asset: assets/test.jpg I/flutter ( 3214): I/flutter ( 3214): When the exception was thrown, this was the stack: I/flutter ( 3214): #0 PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7) I/flutter ( 3214): I/flutter ( 3214): #1
AssetBundleImageProvider._loadAsync (package:flutter/src/painting/image_provider.dart:429:44) I/flutter ( 3214): I/flutter ( 3214): #2
AssetBundleImageProvider.load (package:flutter/src/painting/image_provider.dart:414:14) I/flutter ( 3214): #3 ImageProvider.resolve.. (package:flutter/src/painting/image_provider.dart:267:86) I/flutter ( 3214): #4 ImageCache.putIfAbsent (package:flutter/src/painting/image_cache.dart:143:20) I/flutter ( 3214): #5 ImageProvider.resolve. (package:flutter/src/painting/image_provider.dart:267:63) I/flutter ( 3214): (elided 8 frames from package dart:async) I/flutter ( 3214): I/flutter ( 3214): Image provider: AssetImage(bundle: null, name: "assets/test.jpg") I/flutter ( 3214): Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#81de5(), name: "assets/test.jpg", scale: I/flutter ( 3214): 1.0) I/flutter ( 3214):

 

解决方法: 检查依赖

flutter:
  uses-material-design: true

  assets:
    - assets/test.jpg
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址