当我尝试构建iOS build时,我收到了很多错误。我当前的TestFairy版本是2.0.0。Flutter版本1.22.2。Dart版本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,发布于 2020-10-20 18:33:57
这是维护者。
版本2.0.0只能在迁移到Dart 2作为开发语言的项目中工作。如果您不想这样做,您可以继续使用最新的Dart 1版本。
dependencies:
testfairy: ^1.0.25 # Dart 1
# testfairy: 2.0.0 # Dart 2对于使用migrate连接到Dart 2的用户,请确保您的项目根目录具有一个类似于this的analysis_options.yaml。重要的部分是top声明中的启用实验。
您还必须在run和test命令中启用相同的实验:
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
发布于 2020-10-20 00:49:23
确保您遵循了插件的ReadMe文档,然后尝试以下操作。
flutter clean
rm -rf ios/Podfile ios/Podfile.lock pubspec.lock ios/Pods ios/Runner.xcworkspace
flutter packages pub upgradehttps://stackoverflow.com/questions/64431246
复制相似问题