Skip to content

Updating flutter tool... #15076

Closed
Closed

Description

@ivangn03

Error: Unable to 'pub upgrate' flutter tool. Retrying in five seconds...

Activity

  1. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 2, 2018
  2. Hixie commented on Mar 2, 2018

    @Hixie
    Contributor

    You'll need to tell us more information if you want us to figure out what's going on. :-)

  3. ivangn03 commented on Mar 2, 2018

    @ivangn03
    Author
  4. NathanaelA commented on Mar 2, 2018

    @NathanaelA

    @ivangn03,

    There are a couple things that can cause this issue that I'm aware of...

    1. Make sure you have 7zip installed and in your path, so that you can type "7z" at the command prompt and it works.

    2. If you have a flutter/$cachePath/dart-sdk -- I had this same issue; however Alexander worked with me and we traced down why it was broken. This issue was fixed in Move quotes around to help Powershell 2.0 to substitute variables values. #14907 -- I'm not sure if this has reached the Dev or Beta channels; but it is on Master. If you want to manually apply the patch to your .PS1 file you can see if it fixes it. OR even easier you can manually move the dart-sdk' from the $cachePath into bin\cache\dart-sdkand then restart theflutter upgrade` and it will continue working properly.

    I'm sure there are other reasons; but these two reasons I've run into myself... :-)

  5. mraleph commented on Mar 2, 2018

    @mraleph
    Member

    This can also be a different issue (namely dart-lang/sdk#32314 ). To work-around that one you need to apply this patch against your bin/flutter.bat.

    diff --git a/bin/flutter.bat b/bin/flutter.bat
    index 66cffcf0c..b9678a0e0 100644
    --- a/bin/flutter.bat
    +++ b/bin/flutter.bat
    @@ -28,6 +28,7 @@ SET pub_cache_path=%FLUTTER_ROOT%\.pub-cache
     
     SET dart=%dart_sdk_path%\bin\dart.exe
     SET pub=%dart_sdk_path%\bin\pub.bat
    +SET DART_VM_OPTIONS=--idle_timeout_micros=200000000
     
     REM If available, add location of bundled mingit to PATH
     SET mingit_path=%FLUTTER_ROOT%\bin\mingit\cmd
    @@ -129,7 +130,7 @@ GOTO :after_subroutine
         POPD
     
         :retry_dart_snapshot
    -    CALL "%dart%" --snapshot="%snapshot_path%" --packages="%flutter_tools_dir%\.packages" "%script_path%"
    +    CALL "%dart%" %DART_VM_OPTIONS% --snapshot="%snapshot_path%" --packages="%flutter_tools_dir%\.packages" "%script_path%"
         IF "%ERRORLEVEL%" NEQ "0" (
           ECHO Error: Unable to create dart snapshot for flutter tool. Retrying...
           timeout /t 5 /nobreak
    @@ -142,18 +143,18 @@ GOTO :after_subroutine
     
     :after_subroutine
     
    -CALL "%dart%" %FLUTTER_TOOL_ARGS% "%snapshot_path%" %*
    +CALL "%dart%" %DART_VM_OPTIONS% %FLUTTER_TOOL_ARGS% "%snapshot_path%" %*
     SET exit_code=%ERRORLEVEL%
     
     REM The VM exits with code 253 if the snapshot version is out-of-date.
     IF "%exit_code%" EQU "253" (
    -  CALL "%dart%" --snapshot="%snapshot_path%" --packages="%flutter_tools_dir%\.packages" "%script_path%"
    +  CALL "%dart%" %DART_VM_OPTIONS% --snapshot="%snapshot_path%" --packages="%flutter_tools_dir%\.packages" "%script_path%"
       SET exit_code=%ERRORLEVEL%
       IF "%exit_code%" EQU "253" (
         ECHO Error: Unable to create dart snapshot for flutter tool.
         EXIT /B %exit_code%
       )
    -  CALL "%dart%" %FLUTTER_TOOL_ARGS% "%snapshot_path%" %*
    +  CALL "%dart%" %DART_VM_OPTIONS% %FLUTTER_TOOL_ARGS% "%snapshot_path%" %*
       SET exit_code=%ERRORLEVEL%
     )
     
  6. Hixie commented on Mar 2, 2018

    @Hixie
    Contributor

    You can also install flutter from "master" instead of "beta" (follow the same instructions but replace "beta" with "master" when you do the git clone). Please let us know if this resolves your problems, if it does, we'll close this issue and it'll be resolved when we do our next beta roll in a few weeks.

  7. ivangn03 commented on Mar 2, 2018

    @ivangn03
    Author
  8. Hixie commented on Mar 2, 2018

    @Hixie
    Contributor

    As a general rule, the beta builds are much more stable. We just happen to not have released a beta with the fix for the bug you ran into. :-)

  9. github-actions commented on Sep 3, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  10. locked as resolved and limited conversation to collaborators on Sep 3, 2021
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

    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions