Skip to content

Performance Page doesn't work on VS Code #3132

Closed

Description

@mbokinala

Steps to Reproduce

  1. Run flutter app in profile mode through VS Code
  2. Open flutter devtools through command palette
  3. Select 'Open Performance Page'

Expected results
DevTools performance page should appear

Actual results
"The performance screen is not available for this application" shows up.
image

[✓] Flutter (Channel stable, 2.2.2, on macOS 11.2.3 20D91 darwin-x64, locale en-US)
    • Flutter version 2.2.2 at /Users/mbokinala/Desktop/code/flutter
    • Framework revision d79295af24 (5 days ago), 2021-06-11 08:56:01 -0700
    • Engine revision 91c9fc8fe0
    • Dart version 2.13.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/mbokinala/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/mbokinala/Library/Android/sdk
    • 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 installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    • CocoaPods version 1.10.1

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

[✓] VS Code (version 1.57.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.23.0

[✓] Connected device (1 available)
    • Moto E 4 (mobile) • 10.0.0.57:5555 • android-arm • Android 7.1.1 (API 25)

! Doctor found issues in 1 category.


Another user found something similar in #84676, but I believe @TahaTesser mentioned in a comment that the performance tab was still working at that time.

Activity

  1. kenzieschmoll commented on Jun 16, 2021

    @kenzieschmoll
    Member

    FYI @DanTup

    Does the performance page work when you open DevTools in the browser?

  2. DanTup commented on Jun 16, 2021

    @DanTup
    Contributor

    I think this is due to a version constraint of Flutter v2.3 on the performance page:

    return currentVersion != null &&
    currentVersion >= SemanticVersion(major: 2, minor: 3, patch: 1);

    It looks like for older versions of Flutter there's a 'legacy-performance' page, but VS Code doesn't know about this so always tries to use the performance ID.

    I can update VS Code to change the ID based on the version, although I suspect IntelliJ may have the same. It might be better if there's a way to have stable IDs for the IDEs to use to avoid needing to ship updates to them both if this might happen again (slightly related - someone recently asked me about embedding custom DevTools tabs in VS Code - some API that lets IDEs query what tabs are valid in DevTools might be a way to support both that and this).

  3. kenzieschmoll commented on Jun 16, 2021

    @kenzieschmoll
    Member

    See #3134 for the exact pre-release version we are forking on. Can we add legacy-performance as a bandaid fix for this and file an issue to support the API you are suggesting?

    This forked page scenario isn't common - we just had to do this because I am about to make a breaking change to the core performance page functionality that would not work for older versions of Flutter. But I agree, an API would be a good way to guarantee we don't hit an issue like this in the future.

  4. DanTup commented on Jun 16, 2021

    @DanTup
    Contributor

    Yep, I can do that tomorrow (If I'm reading correctly, 'legacy-performance' is for versions < 2.3.0-16.0?). I'm not sure if IntelliJ may need a similar change too (may depend on whether it lets you launch the Performance page directly).

  5. kenzieschmoll commented on Jun 16, 2021

    @kenzieschmoll
    Member

    'legacy-performance' is for versions < 2.3.0-16.0

    That is correct. FYI @helin24

  6. mbokinala commented on Jun 17, 2021

    @mbokinala
    Author

    @kenzieschmoll

    Does the performance page work when you open DevTools in the browser?

    Yes, the performance page works when I open DevTools in the browser. I see legacy-performance in the url: http://127.0.0.1:9101/?#/legacy-performance?uri=ws%3A%2F%2F127.0.0.1%3A52351%2F_io6OueRNYY%3D%2Fws

  7. DanTup commented on Jun 17, 2021

    @DanTup
    Contributor

    @kenzieschmoll @helin24 the logic here is actually a little more complicated than just checking the Flutter SDK version. The current live DevTools switches on Flutter 2.3.1 so the editor needs to match that when using the current DevTools or the same issue still occurs on Flutter master (it's 2.3.0-17 which is greater than the version mentioned above but live DevTools is still using legacy-performance for it).

    However, once DevTools ships with #3134, the editors will need to change the version they switch on but only for that new DevTools (otherwise things will break for users whose DevTools hasn't upgraded yet and IDEs + DevTools would have to ship at the same time and be reliably updated at the same time by all users).

    So once the version of DevTools that includes #3134 is known, I think the logic should be (and IDEs ideally ship this in advance):

    performancePageId = devToolsVersion <= (future version w/ #3134)
                            // older DevTools switches on 2.3.1
                            ? flutterVersion >= 2.3.1 ? "performance" : "legacy-performance
                            // newer DevTools switches on 2.3.0-16.0 
                            : flutterVersion >= 2.3.0-16.0 ? "performance" : "legacy-performance
    

    I'm going to ship it as just flutterVersion >= 2.3.1 ? "performance" : "legacy-performance today (since I don't know when the PR above will land and what its DevTools version will be), but would like to update again and ship once it's clear what DevTools version will include #3134.

  8. DanTup commented on Jun 17, 2021

    @DanTup
    Contributor

    @mbokinala please run the Extensions: Check for Updates command from the VS Code command palette, then click the blue Reload button next to Dart on the Extensions side bar once it's finished installing (it should show v3.23.1 once updated). With that version, the performance page should work as expected - please let me know if that's not the case. Thanks!

  9. mbokinala commented on Jun 17, 2021

    @mbokinala
    Author

    @DanTup it works once I updated the Dart extension, thanks!

  10. TahaTesser commented on Jul 1, 2021

    @TahaTesser

    @mbokinala
    Given your last message I feel safe to close this issue, if you disagree please write in the comments and I will reopen it.
    Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions