我已经删除了Pub \ Cache \ hosted \ pub.dartlang.org文件夹以更新flutter软件包,但显示flutter软件包中的错误

时间:2020-06-20 08:35:03

标签: flutter flutter-dependencies flutter-test

我试图删除该项目的flutter软件包,并使用以下命令对其进行更新 但找不到此软件包的解决方案是在“ \ Pub \ Cache \ hosted \ pub.dartlang.org \ firebase_admob-0.9.3 + 2”文件夹中找到文件“ pubspec.yaml”。这是错误。谁能告诉我如何从我项目的pubspec.yaml“文件中更新软件包

PS D:\flutter\delimeals> flutter packages get
Waiting for another flutter command to release the startup lock...
Could not find a file named "pubspec.yaml" in "C:\Users\omkar\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_admob-0.9.3+2".
Running "flutter pub get" in delimeals...
pub get failed (66; Could not find a file named "pubspec.yaml" in
"C:\Users\omkar\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_admob-0.9.3+2".)

在我删除pub文件夹后,要删除不需要的软件包,我收到此错误。

PS D:\flutter\delimeals> flutter doctor -v
[√] Flutter (Channel stable, v1.17.3, on Microsoft Windows [Version 10.0.17763.1282], locale en-IN)
    • Flutter version 1.17.3 at D:\flutter\flutter
    • Framework revision b041144f83 (2 weeks ago), 2020-06-04 09:26:11 -0700
    • Engine revision ee76268252
    • Dart version 2.8.4


[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\omkar\AppData\Local\Android\Sdk
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = C:\Users\omkar\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    • All Android licenses accepted.

[√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] VS Code (version 1.46.1)
    • VS Code at C:\Users\omkar\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.11.0

1 个答案:

答案 0 :(得分:0)

试试这个,

  • 运行此命令 flutter pub cache repair
  • flutter clean(来自项目目录)
  • 尝试再次运行