Skip to content

Missing error "Flutter requires PowerShell 5.0 or newer." in IDE #1892

Closed

Description

@pitoszud

The error below is printed in the flutter console (flutter\flutter_console.bat) but VS code and Android studio console (flutter\bin\flutter.bat) do nothing (just waiting for resources), so users who have Powershell below 5.0 don't know that they need to upgrade. This is likely to affect those on Windows 7

It happens after running one of the following commands:

flutter upgrade
flutter update
flutter doctor

Environment variables are set up as follows:

C:\Windows\System32;
E:\flutter\flutter\bin;
E:\git\Git\bin;

Checking Dart SDK version...
The term 'Unblock-File' is not recognized as the name of a cmdlet, function, sc
ript file, or operable program. Check the spelling of the name, or if a path wa
s included, verify that the path is correct and try again.
At line:1 char:13

  • Unblock-File <<<< -Path 'E:\flutter\flutter/bin/internal/update_dart_sdk.ps1
    '; & 'E:\flutter\flutter/bin/internal/update_dart_sdk.ps1'
    • CategoryInfo : ObjectNotFound: (Unblock-File:String) [], Comman
      dNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

Flutter requires PowerShell 5.0 or newer.

Activity

  1. added this to the v3.4.0 milestone on Jul 24, 2019
  2. modified the milestones: v3.4.0, v3.3.0 on Jul 25, 2019
  3. DanTup commented on Jul 25, 2019

    @DanTup
    Member

    Thanks! This is because we don't route all of the output to the console during the setup (because we replace it with a progress indicator). I've changed to now show an error message when this occurs.

    PowerShell

  4. pitoszud commented on Jul 25, 2019

    @pitoszud
    Author

    Thanks Danny,

    "...PowerShell 8.0..." - typo? Just to confirm, I've updated PS to 5.1 and all is working fine now.

  5. DanTup commented on Jul 25, 2019

    @DanTup
    Member

    Heh, the real message from Flutter will be passed through to the UI. I just changed Flutter to temporarily need "PowerShell 8" so that I could test it (since I already had >= 5) 😄

  6. iamkarloramirez commented on Jan 8, 2020

    @iamkarloramirez

    how to update powershell?

  7. DanTup commented on Jan 8, 2020

    @DanTup
    Member

    @iamkarloramirez it's installed with the Windows Management Framework:

    https://www.microsoft.com/en-us/download/details.aspx?id=54616

  8. Emred360 commented on Oct 1, 2020

    @Emred360

    Thanks Danny,

    "...PowerShell 8.0..." - typo? Just to confirm, I've updated PS to 5.1 and all is working fine now.

    Please How did you update your PowerShell?

  9. DanTup commented on Oct 1, 2020

    @DanTup
    Member

    @Emred360 there's a link in the comment above - it's part of the Windows Management Framework.

  10. ankushchk commented on Oct 12, 2020

    @ankushchk

    set

  11. Emred360 commented on Oct 13, 2020

    @Emred360

    @DanTup Thanks for your reply. I have updated my PowerShell.

    But I have a new issue which I've been battling with for a long time now.

    image

  12. DanTup commented on Oct 13, 2020

    @DanTup
    Member

    @Emred360 that seems like a Gradle issue rather than the VS Code plugin so it's not something I'm familiar with. However if the error is to believed, it seems like it's trying to allocate 1.5GB for the heap (possible because Java was launched with Xxm1536?) but is unable to (this may be because you don't have enough RAM).

    You may wish to try some of the suggestions on StackOverflow:

    https://stackoverflow.com/questions/30045417/android-gradle-could-not-reserve-enough-space-for-object-heap/31760855#31760855

    https://stackoverflow.com/questions/30045417/android-gradle-could-not-reserve-enough-space-for-object-heap/41426252#41426252

    Hope this helps!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions