Error: Could not resolve the package 'kernel' in 'package:kernel/util/graph.dart'.
../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.39.2/lib/src/summary2/default_types_builder.dart:15:8: Error: Not found: 'package:kernel/util/graph.dart'
import 'package:kernel/util/graph.dart' show Graph, computeStrongComponents;
^
../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.39.2/lib/src/summary2/default_types_builder.dart:256:39: Error: Type 'Graph' not found.
class _TypeParametersGraph implements Graph<int> {
^^^^^
../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.39.2/lib/src/summary2/default_types_builder.dart:256:39: Error: Expected 0 type arguments.
class _TypeParametersGraph implements Graph<int> {
^
../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.39.2/lib/src/summary2/default_types_builder.dart:125:29: Error: The method 'computeStrongComponents' isn't defined for the class 'DefaultTypesBuilder'.
- 'DefaultTypesBuilder' is from 'package:analyzer/src/summary2/default_types_builder.dart' ('../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.39.2/lib/src/summary2/default_types_builder.dart').
Try correcting the name to the name of an existing method, or defining a method named 'computeStrongComponents'.
var stronglyConnected = computeStrongComponents(graph);
There is no dependency on kernel in the pubspec, but it imports it.
Thanks for reporting this. I'll work on this ASAP.
Pub should also be giving a warning on publish about this. https://github.com/dart-lang/pub/issues/2214 would have prevented this from happening, but we should be paying close attention to warnings when publishing as well.
This issue also affect the test package which I have made an issue on: https://github.com/dart-lang/test/issues/1121
Fix out for review: https://dart-review.googlesource.com/c/sdk/+/127560
Pub should also be giving a warning on publish about this. dart-lang/pub#2214 would have prevented this from happening, but we should be paying close attention to warnings when publishing as well.
True. I was careless and ignored a warning when publishing that would have prevented this bug.
Pub should also be giving a warning on publish about this. dart-lang/pub#2214 would have prevented this from happening, but we should be paying close attention to warnings when publishing as well.
True. I was careless and ignored a warning when publishing that would have prevented this bug.
Please, see this link: https://github.com/dart-lang/protobuf/issues/330.
I still have this error. And is this bug fixed now?
I still have this error.
A _workaround_ is to downgrade test to a working version (I used 1.9.0) and run your tests. This will get kernel into your local package cache. Then you can bring test back to ^1.9.4 and continue working. This will fail on any fresh installation (CI, for example), but at least you get to say "Works on my machine!"
pub global activate kernel will probably have the same effect, but I haven't tried it.
[Edit: thought I was replying in the test thread. Do the same for a working version of analyzer.]
I just published analyzer 0.39.2+1, which should fix this issue. Please feel free to reopen if you're still seeing problems.
Most helpful comment
Pub should also be giving a warning on publish about this. https://github.com/dart-lang/pub/issues/2214 would have prevented this from happening, but we should be paying close attention to warnings when publishing as well.