The instructional messages regarding running devtools displayed after executing flutter build ... --analyze-size are outdated and incorrect. They still include directions to install devtools using pub global activate devtools and run using flutter pub global run devtools, whereas devtools is now included in the dart command and you run devtools using dart devtools.
Example:
To analyze your app size in Dart DevTools, run the following command:
flutter pub global activate devtools; flutter pub global run devtools --appSizeBase=XYZ\aab-code-size-analysis.json
this should now be
To analyze your app size in Dart DevTools, run the following command:
dart devtools --appSizeBase=XYZ\aab-code-size-analysis.json