美文网首页
flutter关于pubspec.yaml finding的问题

flutter关于pubspec.yaml finding的问题

作者: aven_kang | 来源:发表于2022-02-04 14:58 被阅读0次
dependencies:
  flutter:
    sdk: flutter


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.4
  flutter_swiper_null_safety: ^1.0.2
  flutter_screenutil: ^5.0.0+2
  dio: ^4.0.0
  shared_preferences: ^2.0.6
  flutter_inappwebview: ^5.3.2
  provider: ^5.0.0
  crypto: ^3.0.1
  city_pickers: ^1.0.1

在添加完依赖的时候,准备运行,出现这个这个错误

[flutter_app5] flutter pub get
Running "flutter pub get" in flutter_app5...                    
Could not find a file named "pubspec.yaml" in "/Users/huwenkang/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.4".
pub get failed (66; Could not find a file named "pubspec.yaml" in "/Users/huwenkang/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.4".)
exit code 66

那么该如何解决呢,其实很简单,我认为是找不到了那个缓存了,需要删除再重新pub get,就行了

sudo rm -Rf /Users/<username>/.pub-cache
sudo rm -Rf packages

一次执行这两句命令就行,再运行就没有错误了

相关文章

网友评论

      本文标题:flutter关于pubspec.yaml finding的问题

      本文链接:https://www.haomeiwen.com/subject/vddskrtx.html