gpt4 book ai didi

visual-studio-code - "Flutter Code extension not installed"但已安装数月

转载 作者:IT王子 更新时间:2023-10-29 06:50:05 25 4
gpt4 key购买 nike

几个月来一直在 Mac 上使用 Flutter 和 VSCode 没有问题,但是 flutter doctor 突然产生了这个:

[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.4 17E202, locale en-US)
• Flutter version 0.5.1 at [Path]/flutter
• Framework revision c7ea3ca377 (3 weeks ago), 2018-05-29 21:07:33 +0200
• Engine revision 1ed25ca7b7
• Dart version 2.0.0-dev.58.0.flutter-f981f09760

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at [Path]/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.3.1, Build version 9E501
• ios-deploy 1.9.2
• CocoaPods version 1.5.2

[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 25.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[!] VS Code (version 1.24.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected devices (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

! Doctor found issues in 1 category.

我可以确认安装了 flutter,并且自从我开始使用它以来没有任何变化。另外,在我更新 flutter 之前(今天),flutter doctor 在 VSCode 下读到:

[!] VS Code (version 1.24.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Dart Code extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code

但是,升级后似乎无法找到 dart 的问题可能已得到修复。

前几天有个帖子here这表明 flutter doctor 可能暂时不准确,所以我尝试运行该项目,并得到以下错误堆栈:

Using hardware rendering with device Android SDK built for x86. 
If you get graphics artifacts, consider enablingsoftware rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle... 2.0s
Resolving dependencies... 2.2s
Running 'gradlew assembleDebug'...
Error: unable to locate asset entry in pubspec.yaml:
"ios/Flutter/flutter_assets/fonts/MyFlutterApp.ttf".
Error building assets

FAILURE: Build failed with an exception.

* Where:
Script
'[Path]/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 435

* What went wrong:
Execution failed for task ':app:flutterBuildDebug'.
> Process 'command
'[Path]/flutter/bin/flutter'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s
Gradle build failed: 1
MacBook-Pro-3:rambleapp TrentKennelly$ flutter trace
Error connecting to observatory: Exception: Attempted to connect to Dart
observatory 5 times, and all attempts failed. Giving up. The URL was
ws://127.0.0.1:8100/ws

对此有什么想法吗?

最佳答案

VSCode 中的一个更改破坏了扩展检测。忽略此警告是安全的。

请参阅 Danny Tuppeny 关于此问题的完整评论 here .

对于堆栈跟踪,有两件事:

  • Assets “ios/Flutter/flutter_assets/fonts/MyFlutterApp.ttf”是没找到
  • 观察力的问题

您检查 Assets 是否仍然存在?没有它,项目无法编译,天文台问题可能与此有关。

关于visual-studio-code - "Flutter Code extension not installed"但已安装数月,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50995661/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com