“ flutter pub get”无法获取依赖插件

本文讲述了在flutter开发中删除pub缓存目录`/Users/zhimingwen/Develop/flutter/.pub-cache/hosted/pub.flutter-io.cn`来修复因删除依赖后无法拉取的问题,提供了一种有效的方法。
摘要由CSDN通过智能技术生成
Running "flutter pub get" in flutter_tools...                      775ms
    lib/page/home/store/storedetail/selectCouponView/selectCouponDialog.dart:5:8: Error: Error when reading
    '../../../../Develop/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_widget_from_html_core-0.6.2/lib/flutter_widget_from_html_core.dart': No such file or directory
    import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
           ^
    lib/page/home/store/storedetail/selectCouponView/selectCouponDialog.dart:333:40: Error: The method 'HtmlWidget' isn't defined for the class '_SelectCouponDialogState'.
     - '_SelectCouponDialogState' is from 'package:xiantiansaleman/page/home/store/storedetail/selectCouponView/selectCouponDialog.dart' ('lib/page/home/store/storedetail/selectCouponView/selectCouponDialog.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'HtmlWidget'.
                                    child: HtmlWidget(cellData.introduction??'无'),

描述:

在pubspec.yaml中删掉了某个依赖项插件,然后有重新引入这个依赖项插件,会发现一直无法拉取成功。

解决办法:

到pub库缓存目录下,例如mac电脑上是/用户/zhimingwen/Develop/flutter/.pub-cache/hosted/pub.flutter-io.cn/ 目录,删除掉目标插件。重新运行flutter pub get就可以了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值