Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo启动了,但是图片没有加载出来(Unable to load asset) #4

Closed
javayhu opened this issue Apr 22, 2021 · 1 comment
Closed

Comments

@javayhu
Copy link

javayhu commented Apr 22, 2021

操作路径

在 demos/gallery 目录下执行 npm install 和 npm start,然后执行 kraken -u http://localhost:9999/kraken/index.js

➜  gallery git:(main) ✗ kraken -u http://localhost:9999/kraken/index.js
Execute binary: /usr/local/lib/node_modules/@openkraken/cli/build/darwin/debug/app.app/Contents/MacOS/app

flutter: Observatory listening on http://127.0.0.1:63913/dVIwR4G00Eg=/
flutter: ══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════
flutter: The following assertion was thrown resolving an image codec:
flutter: Unable to load asset: demos/gallery/icon/framework.png
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:225:7)
flutter: <asynchronous suspension>
flutter: #1      AssetBundleImageProvider._loadAsync (package:flutter/src/painting/image_provider.dart:668:31)
flutter: #2      AssetBundleImageProvider.load (package:flutter/src/painting/image_provider.dart:651:14)
flutter: #3      ImageProvider.resolveStreamForKey.<anonymous closure> (package:flutter/src/painting/image_provider.dart:504:13)
flutter: #4      ImageCache.putIfAbsent (package:flutter/src/painting/image_cache.dart:355:22)
flutter: #5      ImageProvider.resolveStreamForKey (package:flutter/src/painting/image_provider.dart:502:83)
flutter: #6      ImageProvider.resolve.<anonymous closure> (package:flutter/src/painting/image_provider.dart:333:9)
flutter: #7      ImageProvider._createErrorHandlerAndKey.<anonymous closure>.<anonymous closure> (package:flutter/src/painting/image_provider.dart:463:26)
flutter: (elided 13 frames from dart:async)
flutter:
flutter: Image provider: AssetImage(bundle: null, name: "demos/gallery/icon/framework.png")
flutter: Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#868c5(), name:
flutter:   "demos/gallery/icon/framework.png", scale: 1.0)
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
flutter: Another exception was thrown: Unable to load asset: demos/hello-vue/banner.png
flutter: Another exception was thrown: Unable to load asset: demos/hello-react/banner.png
flutter: Another exception was thrown: Unable to load asset: demos/hello-rax/banner.png
flutter: Another exception was thrown: Unable to load asset: demos/gallery/icon/demo.png
flutter: Another exception was thrown: Unable to load asset: demos/anime/banner.png
flutter: Another exception was thrown: Unable to load asset: demos/calendar/banner.png
flutter: Another exception was thrown: Unable to load asset: demos/granule/banner.png
flutter: Another exception was thrown: Unable to load asset: demos/dragable-list/banner.png
flutter: Another exception was thrown: Unable to load asset: demos/riddles/banner.png
flutter: Another exception was thrown: Unable to load asset: demos/data-grid/banner.png
flutter: Another exception was thrown: Unable to load asset: demos/todomvc/banner.png
flutter: Another exception was thrown: Unable to load asset: demos/wallet/banner.png
flutter: Another exception was thrown: Unable to load asset: demos/order/banner.png
flutter: Kraken DevTool listening at ws://127.0.0.1:9222
flutter: Open Chrome/Edge and paste following url to your navigator:
flutter:     devtools://devtools/bundled/inspector.html?ws=127.0.0.1:9222
@wssgcg1213
Copy link
Member

wssgcg1213 commented Apr 22, 2021

demos/gallery 使用的是相对路径的图片地址, 需要配合 Gallery App 使用~ 或者你也可以修改一下这些图片的路径配合 CLI 使用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants