首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何解决更新TestFairy插件版本后出现的错误?

如何解决更新TestFairy插件版本后出现的错误?
EN

Stack Overflow用户
提问于 2020-10-20 00:12:16
回答 2查看 899关注 0票数 0

当我尝试构建iOS build时,我收到了很多错误。我当前的TestFairy版本是2.0.0。Flutter版本1.22.2。Dart版本2.10.2。

代码语言:javascript
复制
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,
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-10-20 18:33:57

这是维护者。

版本2.0.0只能在迁移到Dart 2作为开发语言的项目中工作。如果您不想这样做,您可以继续使用最新的Dart 1版本。

代码语言:javascript
复制
dependencies:
  testfairy: ^1.0.25 # Dart 1
  # testfairy: 2.0.0 # Dart 2

对于使用migrate连接到Dart 2的用户,请确保您的项目根目录具有一个类似于thisanalysis_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

票数 0
EN

Stack Overflow用户

发布于 2020-10-20 00:49:23

确保您遵循了插件的ReadMe文档,然后尝试以下操作。

代码语言:javascript
复制
flutter clean
rm -rf ios/Podfile ios/Podfile.lock pubspec.lock ios/Pods ios/Runner.xcworkspace
flutter packages pub upgrade
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64431246

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档