Latest version of Dart gRPC breaks Flutter testing

386 views
Skip to first unread message

Matt Stagitis

unread,
Mar 11, 2021, 10:36:23 PM3/11/21
to grpc.io
Hi all,

I've got a Flutter app where I'm using gRPC. I've just started writing some Flutter integration tests [docs] and it looks like the latest version of the grpc dependency (3.0.0) causes a version incompatibility.

Here is the error I've been hitting:
Because every version of flutter_driver from sdk depends on crypto 2.1.5 and grpc 3.0.0 depends on crypto ^3.0.0, flutter_driver from sdk is incompatible with grpc 3.0.0.
And because no versions of grpc match >3.0.0 <4.0.0, flutter_driver from sdk is incompatible with grpc ^3.0.0.
So, because flutterapp depends on both grpc ^3.0.0 and flutter_driver any from sdk, version solving failed.
pub get failed (1; So, because flutterapp depends on both grpc ^3.0.0 and flutter_driver any from sdk, version solving failed.)

Has anyone dealt with this yet? Thanks!

- Matt

Sigurd Meldgaard

unread,
Mar 12, 2021, 3:46:36 AM3/12/21
to grpc.io
Seems like the Flutter team did not get to depend on a null-safety version of crypto before flutter 2.

I can see in the flutter master branch that flutter_driver has been updated to depend on crypto 3.0.0. (https://github.com/flutter/flutter/pull/75370) so things should solve themselves in the next release (beta and stable).

For right now the easiest workaround is probably to use a dependency override (https://dart.dev/tools/pub/dependencies#dependency-overrides) in your app's pubspec.yaml:

dependency_overrides:
  crypto: 3.0.0

It will most likely just work.

m...@google.com

unread,
Mar 12, 2021, 3:48:53 AM3/12/21
to grpc.io
Yes, unfortunately Flutter Driver was the one major component that did not get upgraded to null safety in time for the most recent Flutter stable release:
Reply all
Reply to author
Forward
0 new messages