当我尝试在Vs Code中调试Flutter应用程序时,它会很好地达到断点,但当我将鼠标移到任何变量上查看其值时,我会得到“< optimized out >< error >:< Invalid params >”工具提示。这是在我从3.7升级到3.10之后开始的。在macos和ios调试中都会发生,包括模拟器和实际的iPhone。
我尝试了下面的步骤,没有任何帮助:
- Flutter 清洗
- delete /ios(macos)/Pods
- delete /ios(macos)/Podfile.lock
- Flutter酒吧
1.从内部iOS(macos)文件夹:pod安装 - Flutter 运行
我可以用print语句得到变量的值,这是我现在唯一可以调试的方法。我还删除了flutter sdk的bin/cache目录。flutter doctor -v
:
[✓] Flutter (Channel stable, 3.10.0, on macOS 13.3.1 22E772610a darwin-arm64, locale en-US)
• Flutter version 3.10.0 on channel stable at /Users/aykut/Projects/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 84a1e904f4 (8 days ago), 2023-05-09 07:41:44 -0700
• Engine revision d44b5a94c9
• Dart version 3.0.0
• DevTools version 2.23.1
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0-rc1)
• Android SDK at /Users/aykut/Library/Android/sdk
• Platform android-33, build-tools 32.0.0-rc1
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E222b
• CocoaPods version 1.12.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
[✓] VS Code (version 1.78.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.64.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.3.1 22E772610a darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 113.0.5672.92
[✓] Network resources
• All expected network resources are available.
• No issues found!
2条答案
按热度按时间cetgtptt1#
唯一对我有用的是降级:
bqucvtff2#
将flutter版本从3.7升级到3.10会导致问题。因为在你说的升级后的提示中,我将无法看到变量。如果你想使用最新版本的flutter,也许你可以在你的VS代码编辑器中更新flutter扩展。您可以通过转到View > Extensions或简单地键入Ctrl+shift+x来完成此操作:extensions
如果这不起作用,您可以尝试其他代码编辑器,如Android Studio或IntelliJ IDEA。在这些IDE中,您对Flutter有更多的集成支持,并且可能提供更好的调试体验。如果这些都不起作用,你可以简单地在官方Flutter GitHub存储库上报告问题。请记住,当您报告问题时,您应该提供详细信息以获得帮助。