Flutter 在升级到 3.10 后,在调试时出现<optimized out>消息。

huangapple go评论60阅读模式
英文:

Flutter <optimized out> message while debugging after upgrading to 3.10

问题

When I try to debug a Flutter app in Vs Code, it hits the break point fine, but when I mouse over any variable to see its value, I get "< optimized out >< error >: < Invalid params >" tooltip.
This started after I upgraded to 3.10 from 3.7.
Happens both in macOS and iOS debugging including simulator and actual iPhone.

I tried the steps below with no help:

  1. flutter clean
  2. delete /ios(macos)/Pods
  3. delete /ios(macos)/Podfile.lock
  4. flutter pub get
  5. from inside ios(macos) folder: pod install
  6. flutter run

And I can get the values of variables with print statement, that is the only way I can kinda debug now.
I also deleted bin/cache directory of flutter sdk.

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:
      &#128296; https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      &#128296; 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!
英文:

When I try to debug a Flutter app in Vs Code, it hits the break point fine, but when I mouse over any variable to see its value, I get "< optimized out >< error >: < Invalid params >" tooltip.
This started after I upgraded to 3.10 from 3.7.
Happens both in macos and ios debugging including simulator and actual iphone.

I tried the steps below with no help:

  1. flutter clean
  2. delete /ios(macos)/Pods
  3. delete /ios(macos)/Podfile.lock
  4. flutter pub get
  5. from inside ios(macos) folder: pod install
  6. flutter run

And I can get the values of variables with print statement, that is the only way I can kinda debug now.
I also deleted bin/cache directory of flutter sdk.

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:
      &#128296; https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      &#128296; 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!

答案1

得分: 5

The only thing that worked for me is downgrading:

flutter downgrade 3.7.1

英文:

The only thing that worked for me is downgrading:

flutter downgrade 3.7.1

huangapple
  • 本文由 发表于 2023年5月17日 10:02:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/76268121.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定