I receive a lot the errors when I try to build iOS build. My current version of TestFairy is 2.0.0. Flutter version 1.22.2. Dart version 2.10.2.
Xcode's output:
↳
../../../../../.pub-cache/hosted/pub.dartlang.org/testfairy-2.0.0/lib/testfairy.dart:201:23: Error: This requires the null safety language feature, which is experimental.
You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
static Future<String?> getSessionUrl() async {
^
../../../../../.pub-cache/hosted/pub.dartlang.org/testfairy-2.0.0/lib/testfairy.dart:416:13: Error: This requires the null safety language feature, which is experimental.
You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
String? errorMessage) async {
^
../../../../../.pub-cache/hosted/pub.dartlang.org/testfairy-2.0.0/lib/testfairy.dart:442:14: Error: This requires the null safety language feature, which is experimental.
You can enable the experiment using the '--enable-experiment=non-nullable' command line option.
{String? defaultText,
This is the maintainer.
The version 2.0.0 can only work in projects which migrated to Dart 2 as the development language. If you don't want to do that, you can stay in the latest Dart 1 release.
For people who migrate to Dart 2, make sure your project root has an
analysis_options.yaml
that looks similar to this. The important part is the enabled experiment in the top declaration.You also have to enable the same experiment in your run and test commands:
flutter run --enable-experiment=non-nullable --no-sound-null-safety
flutter drive --enable-experiment=non-nullable --no-sound-null-safety -v --target=test_driver/app.dart