请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

SocketException: Failed host lookup: 'dimg04.c-ctrip.com'

为什么我获取图片的时候利用Image.network之后会报这种错误:
Another exception was thrown: SocketException: Failed host lookup: ‘dimg04.c-ctrip.com’ (OS Error: No address associated with ho
stname, errno = 7)
图片描述swiper是这么写的:

List _imageUrls = [
  'http://pages.ctrip.com/commerce/promote/20180718/yxzy/img/640sygd.jpg',
  'http://dimg04.c-ctrip.com/images/700u0r000000gxvb93E54_810_235_85.jpg',
  'http://dimg04.c-ctrip.com/images/700c10000000pdili7D8B_780_235_57.jpg'
];
child: Swiper(
  itemCount: _imageUrls.length,
  autoplay: true,
  itemBuilder: (BuildContext context, int index) {
    return Image.network(
      _imageUrls[index],
      fit: BoxFit.fill,
    );
  },
  pagination: SwiperPagination(),
),

正在回答 回答被采纳积分+3

2回答

提问者 QM启梦科技 2019-07-16 10:58:52

我知道了,是虚拟机的地址发生了转变。将虚拟机关闭重启虚拟机再启动项目就好了。

2 回复 有任何疑惑可以回复我~
weixin_慕圣4150750 2021-03-10 22:50:33

遇到了一摸一样的问题,请问这个虚拟机重启的这个怎么操作啊

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号