Skip to content

All pub command is unavailble after a pub add command #3891

Description

@Taoduhui
Running pub upgrade...
Null check operator used on a null value
package:pub/src/system_cache.dart 50:52                SystemCache.defaultDir.<fn>
package:pub/src/system_cache.dart 60:5                 SystemCache.defaultDir
package:pub/src/system_cache.dart                      SystemCache.defaultDir
package:pub/src/system_cache.dart 98:42                new SystemCache
package:pub/src/command.dart 65:34                     PubCommand.cache
package:pub/src/command.dart                           PubCommand.cache
package:pub/src/command.dart 78:29                     PubCommand.entrypoint
package:pub/src/command.dart                           PubCommand.entrypoint
package:pub/src/command/upgrade.dart 112:25            UpgradeCommand.runProtected
package:pub/src/command.dart 190:45                    PubCommand.run.<fn>
dart:async                                             new Future.sync
package:pub/src/utils.dart 111:12                      captureErrors.wrappedCallback
dart:async                                             runZonedGuarded
package:pub/src/utils.dart 128:5                       captureErrors
package:pub/src/command.dart 190:13                    PubCommand.run
package:args/command_runner.dart 212:27                CommandRunner.runCommand
package:pub/src/command_runner.dart 176:24             PubCommandRunner.runCommand
package:pub/src/command_runner.dart 161:20             PubCommandRunner.run
package:dartdev/dartdev.dart 49:47                     runDartdev
C:\b\s\w\ir\x\w\sdk\pkg\dartdev\bin\dartdev.dart 11:9  main
An unexpected error was encountered by the Dart CLI.
Please file an issue at https://github.com/dart-lang/sdk/issues/new with the following details:

Invocation: 'dart __deprecated_pub upgrade --verbosity=error --no-precompile'
Exception: 'Null check operator used on a null value'
Stack Trace:
#0      SystemCache.defaultDir.<anonymous closure> (package:pub/src/system_cache.dart:50:52)
dart-lang/sdk#1      SystemCache.defaultDir (package:pub/src/system_cache.dart:60:5)
dart-lang/sdk#2      SystemCache.defaultDir (package:pub/src/system_cache.dart)
dart-lang/sdk#3      new SystemCache (package:pub/src/system_cache.dart:98:42)
dart-lang/sdk#4      PubCommand.cache (package:pub/src/command.dart:65:34)
dart-lang/sdk#5      PubCommand.cache (package:pub/src/command.dart)
dart-lang/sdk#6      PubCommand.transcriptPath (package:pub/src/command.dart:337:19)
dart-lang/sdk#7      PubCommand.run (package:pub/src/command.dart:204:6)
<asynchronous suspension>
dart-lang/sdk#8      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
dart-lang/sdk#9      PubCommandRunner.runCommand (package:pub/src/command_runner.dart:176:12)
<asynchronous suspension>
dart-lang/sdk#10     PubCommandRunner.run (package:pub/src/command_runner.dart:161:14)
<asynchronous suspension>
dart-lang/sdk#11     runDartdev (package:dartdev/dartdev.dart:49:18)
<asynchronous suspension>
dart-lang/sdk#12     main (file:///C:/b/s/w/ir/x/w/sdk/pkg/dartdev/bin/dartdev.dart:11:3)
<asynchronous suspension>

Error (255): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (5 tries left)

after i run pub add file_picker, all pub command will throw above error.
i try to repair it by pub clean and pub cache repair, looks no effect.
then i reinstall the dart sdk, no effect too.

Activity

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

    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions