简体   繁体   English

图片源无法从 URL 加载,知道为什么会这样吗?

[英]image source failed to load from URL, any idea why it's happening?

I'm using Google Books API to make it an application program using flutter on android studio, but the displayed image can't be loaded on the URL with the following description coming out;我在android studio上使用Google Books API使其成为使用flutter的应用程序,但显示的图像无法在URL上加载,出现以下描述;

Running with unsound null safety For more information see https://dart.dev/null-safety/unsound-null-safety Debug service listening on ws://127.0.0.1:53771/9sOn-nopEoY=/ws XMLHttpRequest error.运行不正常 null safety 有关更多信息,请参阅https://dart.dev/null-safety/unsound-null-safety调试服务侦听 ws://127.0.0.1:53771/9sOn-nopEoY=/ws XMLHttpRequest 错误。

The following ImageCodecException was thrown resolving an image codec:
Failed to load network image.
Image URL: http://books.google.com/books/content?id=WiEpzgEACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api
Trying to load an image from another domain? Find answers at:
https://flutter.dev/docs/development/platform-integration/web-images

When the exception was thrown, this was the stack: 
Image provider: NetworkImage("http://books.google.com/books/content?id=WiEpzgEACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api", scale: 1)
Image key: NetworkImage("http://books.google.com/books/content?id=WiEpzEACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api", scale: 1)
====================================================================================================```

[display of errors that occur in screenshots][1]

[display of errors that occur in screenshots][2]

  [1]: https://i.stack.imgur.com/189rY.png
  [2]: https://i.stack.imgur.com/ujA7s.png

does anyone know where the error from the program?

when I check the URL on my browser, it says no image available.当我在浏览器上查看 URL 时,它说没有可用图像。 that might be the cause.这可能是原因。

Image cannot be loaded from other domains like error says.无法像错误所说的那样从其他域加载图像。 Like the link from the error suggests HtmlElementView can be used to overcome this.就像错误中的链接表明HtmlElementView可以用来克服这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM