【问题标题】:Sudden Error appears when debugging and hot reloading the app调试和热重新加载应用程序时出现突然错误
【发布时间】:2020-08-05 10:21:18
【问题描述】:

我现在超级困惑。以下错误只是在我调试应用程序的某些部分时出现,当我按下热重载时突然出现:

Running "flutter pub get" in storeangels...                     
Could not find a file named "pubspec.yaml" in "/Users/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-0.0.2+1".
pub get failed (66; Could not find a file named "pubspec.yaml" in "/Users/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-0.0.2+1".)

Error

这是我在搜索 shared_preferences_linux 的东西时发现的

[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.4 19E287, locale en-GB)
    • Flutter version 1.17.5 at /Users/flutter
    • Framework revision 8af6b2f038 (5 weeks ago), 2020-06-30 12:53:55 -0700
    • Engine revision ee76268252
    • Dart version 2.8.4

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/hottube/Library/Android/sdk
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

• No issues found!

如果有人知道在这里做什么,我将不胜感激

【问题讨论】:

  • 删除/Users/flutter/.pub-cache/再试一次

标签: linux android-studio flutter sharedpreferences


【解决方案1】:

你试过flutter clean 吗?这修复了我的许多错误。

【讨论】:

    【解决方案2】:

    好的,一位同事能够为我的问题提供解决方案。 我不得不在 android studio 的终端中编写以下命令:

    flutter pub pub cache repair
    

    这为我修复了错误。

    【讨论】:

      猜你喜欢
      • 2019-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-10
      • 1970-01-01
      • 1970-01-01
      • 2018-05-24
      • 1970-01-01
      相关资源
      最近更新 更多