Closed ValentinVignal closed 9 months ago
It seems like LeakTesting
was removed from leak_tracker_flutter_testing
in the version 1.0.10
and added to leak_tracker_testing
in the version 1.0.6
. But leak_tracker_testing >=1.0.6
depends on meta ^1.11.0
which seems incompatible with flutter stable 3.16.9
:
Resolving dependencies...
Note: meta is pinned to version 1.10.0 by flutter_test from the flutter SDK.
See https://dart.dev/go/sdk-version-pinning for details.
Because every version of flutter_test from sdk depends on meta 1.10.0 and leak_tracker_testing >=1.0.6 depends on meta ^1.11.0, flutter_test from sdk is incompatible with leak_tracker_testing >=1.0.6.
So, because flutter_app_stable depends on both leak_tracker_testing ^1.0.6 and flutter_test from sdk, version solving failed.
You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on leak_tracker_testing: flutter pub add leak_tracker_testing:^1.0.5
My fix is to change my pubspec.yaml
to use leak_tracker_flutter_testing: 1.0.9
:
leak_tracker_flutter_testing: 1.0.9
and my test/flutter_test_config.dart
becomes:
import 'dart:async';
import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';
FutureOr<void> testExecutable(FutureOr<void> Function() testMain) {
LeakTesting.settings = LeakTesting.settings.withTrackedAll();
return testMain();
}
However, I tried to add it to go_router
https://github.com/flutter/packages/tree/main/packages/go_router and no test is failing, unlike you showed me @polina-c .
Can this package be used on flutter stable 3.16.9
?
Oh, yes, for now leak_tracker works just for flutter starting 3.18.0. May be it makes it impossible to adopt leak tracker for flutter packages at the moment and it should be postponed..
Thanks for trying and discovering it!!! Adding to documentation: https://github.com/dart-lang/leak_tracker/pull/216
I'm following https://github.com/dart-lang/leak_tracker/blob/main/doc/leak_tracking/DETECT.md :
When using the latest flutter stable:
and run
flutter pub add leak_tracker_flutter_testing
in a brand new project, I get the version2.0.0
ofleak_tracker_flutter_testing
:When add the
test/flutter_test_config.dart
:LeakTesting
is not defined:Running
flutter analyze
:You can checkout https://github.com/ValentinVignal/flutter_app_stable/tree/leak_tracker_flutter_testing/Test-on-flutter-3.16