Skip to content

Intermittent null exception during dependency resolution after upgrading to flutter 3.38.10 w/ dart 3.10.9. #4828

@jonl-percsolutions-com

Description

@jonl-percsolutions-com

A change introduced in 8a994cbbfd515823e990234e8823ba73ce739ca8 in package_graph is causing intermittent null pointer exceptions due to the line final currentPackage = packages[current]!;. This has introduced an intermittent null pointer exception during our ci/cd process where we run the build in a fresh container, with no cache and gather the list of dependencies using the line dart pub deps -s compact --no-dev >> build_info.md

Set up:

Running Jenkins pipeline in a custom debian bookwork based container, building a docker image.

Logs:

[2026-05-19T20:09:31.119Z] + flutter --version
[2026-05-19T20:09:31.119Z] Flutter 3.38.10 • channel [user-branch] • unknown source
[2026-05-19T20:09:31.119Z] Framework • revision c6f67dede3 (3 months ago) • 2026-02-10 11:05:04 -0800
[2026-05-19T20:09:31.119Z] Engine • hash 3c25ef829c74f0f39fbb8df093d9a6b9f941ea6b (revision cafcda5721) (3 months ago) • 2026-02-06 18:51:35.000Z
[2026-05-19T20:09:31.119Z] Tools • Dart 3.10.9 • DevTools 2.51.1
[2026-05-19T20:09:31.119Z] + date +%Y-%m-%d %H:%M:%S %Z
[2026-05-19T20:09:31.119Z] + BUILD_DATE=2026-05-19 20:09:31 UTC
[2026-05-19T20:09:31.119Z] + dart pub deps -s compact --no-dev
2026-05-19T20:09:43.314Z] [Pipeline] }
[2026-05-19T20:09:43.369Z] [Pipeline] // withCredentials
[2026-05-19T20:09:43.450Z] [Pipeline] }
[2026-05-19T20:09:43.505Z] [Pipeline] // withCredentials
[2026-05-19T20:09:43.563Z] [Pipeline] }
[2026-05-19T20:09:43.621Z] [Pipeline] // withCredentials
[2026-05-19T20:09:43.682Z] [Pipeline] }
[2026-05-19T20:09:43.739Z] [Pipeline] // withCredentials
[2026-05-19T20:09:43.797Z] [Pipeline] }
[2026-05-19T20:09:43.858Z] [Pipeline] // dir
[2026-05-19T20:09:43.915Z] [Pipeline] }
[2026-05-19T20:09:43.973Z] [Pipeline] // script
[2026-05-19T20:09:44.036Z] [Pipeline] }
[2026-05-19T20:09:44.097Z] [Pipeline] // stage
[2026-05-19T20:09:44.157Z] [Pipeline] stage
[2026-05-19T20:09:44.157Z] [Pipeline] { (Buid Image)
[2026-05-19T20:09:44.214Z] Stage "Buid Image" skipped due to earlier failure(s)
[2026-05-19T20:09:44.215Z] [Pipeline] getContext
[2026-05-19T20:09:44.216Z] [Pipeline] }
[2026-05-19T20:09:44.274Z] [Pipeline] // stage
[2026-05-19T20:09:44.334Z] [Pipeline] stage
[2026-05-19T20:09:44.335Z] [Pipeline] { (Declarative: Post Actions)
[2026-05-19T20:09:44.399Z] [Pipeline] sh
[2026-05-19T20:09:44.683Z] + LOG=/tmp/.pub-cache/log/pub_log.txt
[2026-05-19T20:09:44.683Z] + [ -f /tmp/.pub-cache/log/pub_log.txt ]
[2026-05-19T20:09:44.683Z] + cat /tmp/.pub-cache/log/pub_log.txt
[2026-05-19T20:09:44.683Z] Information about the latest pub run.
[2026-05-19T20:09:44.683Z]
[2026-05-19T20:09:44.683Z] If you believe something is not working right, you can go to
[2026-05-19T20:09:44.683Z] https://github.com/dart-lang/pub/issues/new to post a new issue and attach this file.
[2026-05-19T20:09:44.683Z]
[2026-05-19T20:09:44.683Z] Before making this file public, make sure to remove any sensitive information!
[2026-05-19T20:09:44.683Z]
[2026-05-19T20:09:44.683Z] Pub version: 3.10.9
[2026-05-19T20:09:44.683Z] Created: 2026-05-19T20:09:41.446546
[2026-05-19T20:09:44.683Z] FLUTTER_ROOT: /usr/local/flutter
[2026-05-19T20:09:44.683Z] PUB_HOSTED_URL: https://artifactory.dc.percsolutions.net/artifactory/api/pub/pub-dart
[2026-05-19T20:09:44.683Z] PUB_CACHE: "/tmp/.pub-cache"
[2026-05-19T20:09:44.683Z] Command: dart pub deps -s compact --no-dev
[2026-05-19T20:09:44.683Z] Platform: linux
[2026-05-19T20:09:44.683Z]
.....
[2026-05-19T20:09:45.332Z] IO : Writing 131 characters to text file /tmp/.pub-cache/active_roots/9a/43cf541feb8350b82d6714189278d8bccf3d7d58bfa86de4ace998b5b5c779.
[2026-05-19T20:09:45.332Z] FINE: Contents:
[2026-05-19T20:09:45.332Z] | {"package_config":"file:///home/jenkins/workspace/PDSuite/Build%20PD%20Suite%20Image/pd_suite_app/.dart_tool/package_config.json"}
[2026-05-19T20:09:45.332Z] ERR : Null check operator used on a null value

[2026-05-19T20:09:45.332Z] FINE: Exception type: _TypeError

[2026-05-19T20:09:45.332Z] ERR : package:pub/src/package_graph.dart 62 PackageGraph.transitiveDependencies

[2026-05-19T20:09:45.332Z] | package:pub/src/command/deps.dart 421 DepsCommand._getAllDependencies.

[2026-05-19T20:09:45.332Z] | dart:core List.toSet

[2026-05-19T20:09:45.332Z] | package:pub/src/command/deps.dart 427 DepsCommand._getAllDependencies

[2026-05-19T20:09:45.332Z] | ===== asynchronous gap ===========================

[2026-05-19T20:09:45.332Z] | package:pub/src/command/deps.dart 395 DepsCommand._getTransitiveDependencies

[2026-05-19T20:09:45.332Z] | ===== asynchronous gap ===========================

[2026-05-19T20:09:45.332Z] | package:pub/src/command/deps.dart 241 DepsCommand._outputCompact

[2026-05-19T20:09:45.332Z] | ===== asynchronous gap ===========================

[2026-05-19T20:09:45.332Z] | package:pub/src/command/deps.dart 192 DepsCommand.runProtected

[2026-05-19T20:09:45.332Z] | ===== asynchronous gap ===========================

[2026-05-19T20:09:45.332Z] | package:pub/src/command.dart 197 PubCommand.run

[2026-05-19T20:09:45.332Z] | ===== asynchronous gap ===========================

[2026-05-19T20:09:45.332Z] | package:args/command_runner.dart 212 CommandRunner.runCommand

[2026-05-19T20:09:45.332Z] | ===== asynchronous gap ===========================

[2026-05-19T20:09:45.332Z] | package:dartdev/dartdev.dart 265 DartdevRunner.runCommand

[2026-05-19T20:09:45.332Z] | ===== asynchronous gap ===========================

[2026-05-19T20:09:45.332Z] | package:dartdev/dartdev.dart 51 runDartdev

[2026-05-19T20:09:45.332Z] | ===== asynchronous gap ===========================

[2026-05-19T20:09:45.332Z] | /b/s/w/ir/x/w/sdk/pkg/dartdev/bin/dartdev.dart 13 main

[2026-05-19T20:09:45.332Z] ERR : This is an unexpected error. The full log and other details are collected in:

Originally posted by @jonl-percsolutions-com in 8a994cb

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions