dart-lang / pub

The pub command line tool
https://dart.dev/tools/pub/cmd
BSD 3-Clause "New" or "Revised" License
1.04k stars 224 forks source link

Add dependency issue #4323

Closed 0xiammatrixx closed 1 month ago

0xiammatrixx commented 1 month ago
Version solving took 0:00:01.089810 seconds. Tried 1 solutions. FINE: Resolving dependencies finished (1.3s). MSG : Downloading packages... FINE: Downloading packages finished (0.0s). IO : Get versions from https://pub.dev/api/packages/http. IO : HTTP GET https://pub.dev/api/packages/http Accept: application/vnd.pub.v2+json X-Pub-OS: windows X-Pub-Command: get X-Pub-Session-ID: 1D04314A-2479-4230-908C-DF0408FC68FC X-Pub-Environment: vscode.dart-code:flutter_cli:get user-agent: Dart pub 3.4.3 IO : Attempt #2 for fetching versions for "http" from "https://pub.dev/api/packages/http" IO : HTTP GET https://pub.dev/api/packages/http Accept: application/vnd.pub.v2+json X-Pub-OS: windows X-Pub-Command: get X-Pub-Session-ID: 1D04314A-2479-4230-908C-DF0408FC68FC X-Pub-Environment: vscode.dart-code:flutter_cli:get user-agent: Dart pub 3.4.3 IO : Attempt #3 for fetching versions for "http" from "https://pub.dev/api/packages/http" IO : HTTP GET https://pub.dev/api/packages/http Accept: application/vnd.pub.v2+json X-Pub-OS: windows X-Pub-Command: get X-Pub-Session-ID: 1D04314A-2479-4230-908C-DF0408FC68FC X-Pub-Environment: vscode.dart-code:flutter_cli:get user-agent: Dart pub 3.4.3 IO : Attempt #4 for fetching versions for "http" from "https://pub.dev/api/packages/http" IO : HTTP GET https://pub.dev/api/packages/http Accept: application/vnd.pub.v2+json X-Pub-OS: windows X-Pub-Command: get X-Pub-Session-ID: 1D04314A-2479-4230-908C-DF0408FC68FC X-Pub-Environment: vscode.dart-code:flutter_cli:get user-agent: Dart pub 3.4.3 IO : Attempt #5 for fetching versions for "http" from "https://pub.dev/api/packages/http" IO : HTTP GET https://pub.dev/api/packages/http Accept: application/vnd.pub.v2+json X-Pub-OS: windows X-Pub-Command: get X-Pub-Session-ID: 1D04314A-2479-4230-908C-DF0408FC68FC X-Pub-Environment: vscode.dart-code:flutter_cli:get user-agent: Dart pub 3.4.3 IO : Attempt #6 for fetching versions for "http" from "https://pub.dev/api/packages/http" IO : HTTP GET https://pub.dev/api/packages/http Accept: application/vnd.pub.v2+json X-Pub-OS: windows X-Pub-Command: get X-Pub-Session-ID: 1D04314A-2479-4230-908C-DF0408FC68FC X-Pub-Environment: vscode.dart-code:flutter_cli:get user-agent: Dart pub 3.4.3 IO : Attempt #7 for fetching versions for "http" from "https://pub.dev/api/packages/http" IO : HTTP GET https://pub.dev/api/packages/http Accept: application/vnd.pub.v2+json X-Pub-OS: windows X-Pub-Command: get X-Pub-Session-ID: 1D04314A-2479-4230-908C-DF0408FC68FC X-Pub-Environment: vscode.dart-code:flutter_cli:get user-agent: Dart pub 3.4.3 ERR : Null check operator used on a null value FINE: Exception type: _TypeError ERR : package:pub/src/source/hosted.dart 760:33 HostedSource._getAdvisories.readAdvisoriesFromCache ===== asynchronous gap =========================== package:pub/src/source/hosted.dart 778:12 HostedSource._getAdvisories ===== asynchronous gap =========================== package:pub/src/source/hosted.dart 1066:24 HostedSource.getAdvisoriesForPackageVersion ===== asynchronous gap =========================== package:pub/src/solver/report.dart 414:26 SolveReport._reportPackage ===== asynchronous gap =========================== package:pub/src/solver/report.dart 218:18 SolveReport._reportChanges ===== asynchronous gap =========================== package:pub/src/solver/report.dart 73:21 SolveReport.show ===== asynchronous gap =========================== package:pub/src/entrypoint.dart 568:5 Entrypoint.acquireDependencies ===== asynchronous gap =========================== package:pub/src/command/get.dart 77:5 GetCommand.runProtected ===== asynchronous gap =========================== package:pub/src/command.dart 196:7 PubCommand.run ===== asynchronous gap =========================== package:args/command_runner.dart 212:13 CommandRunner.runCommand ===== asynchronous gap =========================== package:dartdev/dartdev.dart 232:18 DartdevRunner.runCommand ===== asynchronous gap =========================== package:dartdev/dartdev.dart 46:16 runDartdev ===== asynchronous gap =========================== C:\b\s\w\ir\x\w\sdk\pkg\dartdev\bin\dartdev.dart 13:5 main ERR : This is an unexpected error. The full log and other details are collected in:
C:\Users\DELL\AppData\Local\Pub\Cache\log\pub_log.txt
Consider creating an issue on https://github.com/dart-lang/pub/issues/new
and attaching the relevant parts of that log file.

---- End log transcript ----

MobinAssari commented 1 month ago

same problem

equescodebelike commented 1 month ago

same, but on mac it works

AlexV525 commented 1 month ago

@sigurdm Could this be something affected by recent pub.dev changes? We also run into this randomly even with pub.flutter-io.cn.

AlexV525 commented 1 month ago

package:pub/src/source/hosted.dart 760:33 HostedSource._getAdvisories.readAdvisoriesFromCache does not contain force promotion, so I guess the stack trace is: https://github.com/dart-lang/pub/blob/ea4a1c854690d3abceb92c8cc2c6454470f9d5a7/lib/src/source/hosted.dart#L777-L779

sigurdm commented 1 month ago

Duplicate of https://github.com/dart-lang/pub/issues/4269

This is be fixed in 3.4.4 https://github.com/dart-lang/sdk/blob/stable/CHANGELOG.md#344---2024-06-12